Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.64 KB

File metadata and controls

31 lines (20 loc) · 1.64 KB
description Importing data into Metacity

Data Import

Metacity currently supports the following formats:

FormatSuffixReference
Shapefile.shpESRI Shapefile Technical Description
GeoJSON.jsonThe GeoJSON Specification (RFC 7946)
OBJ.objOBJ wiki page

Importing data is fairly easy with the functionalities provided by the metacity.io module:

Importing a single file

from metacity.io import parse
#parse(file: str) -> List[Models]
models = parse("data/file.shp")

The parse function loads contents of a provided file and returns a list of Models.

Importing multiple files

Often, the geospatial data is partitioned into several files and scattered among several directories. If you wish to import all of the data located in the directory tree under a certain folder, you can do:

from metacity.io import parse_recursively
#parse_recursively(dir: str) -> List[Models]
models = parse_recursively("data")

The returned value is a flattened list of Models regardless of how many files were processed.