-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #808 from UXARRAY/rajeeja/io_shapefile
Implement `Grid.open_file` method support non xarray formats including Shapefile/Geojson
- Loading branch information
Showing
30 changed files
with
1,065 additions
and
1,445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ dependencies: | |
- scipy | ||
- shapely | ||
- spatialpandas | ||
- geopandas | ||
- xarray | ||
- asv | ||
- pip: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ dependencies: | |
- scipy | ||
- shapely | ||
- spatialpandas | ||
- geopandas | ||
- xarray | ||
- asv | ||
- pip: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
GeoJSON is a format for encoding a variety of geographic data structures, including points, lines, and polygons. | ||
|
||
This repository contains "sample_chicago_buildings" GeoJSON file featuring a selection of buildings in Chicago. The file includes: | ||
|
||
Number of polygons: 10 | ||
Polygon 1: 26 sides | ||
Polygon 2: 36 sides | ||
Polygon 3: 29 sides | ||
Polygon 4: 10 sides | ||
Polygon 5: 30 sides | ||
Polygon 6: 8 sides | ||
Polygon 7: 7 sides | ||
Polygon 8: 9 sides | ||
Polygon 9: 7 sides | ||
Polygon 10: 19 sides |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ISO-8859-1 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### There are 3 sub folders each containing different shapefile examples | ||
|
||
1. **5poly** : A very simple file containing only 5 polygons with different number of sides | ||
2. **cb_2018_us_national_20m**: Real word shapefile containing the 2018 Census Bureau US map at 20m resolution | ||
3. **multipoly**: Test file containing multipolygons. | ||
|
||
### Files Included in the Shapefile Dataset | ||
|
||
1. **.shp** - **Shape Format**: Contains the geometric data (polygons) for the features in the dataset. The first 100 bytes contain metadata about the file. | ||
|
||
2. **.shx** - **Shape Index Format**: Contains the index data for the .shp file, allowing for quick access to the geometric data. | ||
|
||
3. **.dbf** - **Attribute Format**: Contains attribute data for the features in the .shp file. This is a dBase file that stores information in a tabular format, where each row corresponds to a feature in the .shp file. | ||
|
||
4. **.cpg** - **Code Page Format**: Contains character encoding information for the .dbf file, ensuring that text data is correctly interpreted. Eg. ISO-8859-1 |
1 change: 1 addition & 0 deletions
1
test/meshfiles/shp/cb_2018_us_nation_20m/cb_2018_us_nation_20m.cpg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
UTF-8 |
Binary file not shown.
1 change: 1 addition & 0 deletions
1
test/meshfiles/shp/cb_2018_us_nation_20m/cb_2018_us_nation_20m.prj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] |
Binary file not shown.
119 changes: 119 additions & 0 deletions
119
test/meshfiles/shp/cb_2018_us_nation_20m/cb_2018_us_nation_20m.shp.ea.iso.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--This file contains all the Entity and Attribute Information--><gfc:FC_FeatureCatalogue xmlns:gmx="http://www.isotc211.org/2005/gmx" | ||
xmlns:gco="http://www.isotc211.org/2005/gco" | ||
xmlns:gmd="http://www.isotc211.org/2005/gmd" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xmlns:gml="http://www.opengis.net/gml/3.2" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:gfc="http://www.isotc211.org/2005/gfc" | ||
xsi:schemaLocation="https://www.ngdc.noaa.gov/metadata/published/xsd/schema/gfc/featureCataloging.xsd http://www.isotc211.org/2005/gfc"> | ||
<gmx:name> | ||
<gco:CharacterString>Feature Catalog for the 2018 United States 1:20,000,000 Cartographic Boundary File</gco:CharacterString> | ||
</gmx:name> | ||
<gmx:scope> | ||
<gco:CharacterString>The United States at a scale of 1:20,000,000</gco:CharacterString> | ||
</gmx:scope> | ||
<gmx:versionNumber> | ||
<gco:CharacterString>cb_2018_nation_20m</gco:CharacterString> | ||
</gmx:versionNumber> | ||
<gmx:versionDate> | ||
<gco:Date>2019-05</gco:Date> | ||
</gmx:versionDate> | ||
<gmx:language> | ||
<gco:CharacterString>eng</gco:CharacterString> | ||
</gmx:language> | ||
<gmx:characterSet> | ||
<gmd:MD_CharacterSetCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode" | ||
codeListValue="utf8" | ||
codeSpace="004">utf8 | ||
</gmd:MD_CharacterSetCode> | ||
</gmx:characterSet> | ||
<gfc:producer xlink:href="https://www.ngdc.noaa.gov/docucomp/1df27e57-4768-42de-909b-52f530601fba" | ||
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geographic Customer Services Branch"/> | ||
<gfc:featureType> | ||
<gfc:FC_FeatureType> | ||
<gfc:typeName> | ||
<gco:LocalName>cb_2018_us_nation_20m.shp</gco:LocalName> | ||
</gfc:typeName> | ||
<gfc:definition> | ||
<gco:CharacterString>Current Nation (national)</gco:CharacterString> | ||
</gfc:definition> | ||
<gfc:isAbstract> | ||
<gco:Boolean>false</gco:Boolean> | ||
</gfc:isAbstract> | ||
<gfc:featureCatalogue uuidref="2018_nation_20m.ea.iso.xml"/> | ||
<gfc:carrierOfCharacteristics> | ||
<gfc:FC_FeatureAttribute> | ||
<gfc:memberName> | ||
<gco:LocalName>AFFGEOID</gco:LocalName> | ||
</gfc:memberName> | ||
<gfc:definition> | ||
<gco:CharacterString>American FactFinder summary level code + geovariant code + '00US'</gco:CharacterString> | ||
</gfc:definition> | ||
<gfc:cardinality gco:nilReason="unknown"/> | ||
<gfc:definitionReference xlink:title="U.S. Census Bureau" | ||
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/> | ||
<gfc:listedValue> | ||
<gfc:FC_ListedValue> | ||
<gfc:label> | ||
<gco:CharacterString>American FactFinder geographic identifier</gco:CharacterString> | ||
</gfc:label> | ||
<gfc:definitionReference xlink:title="U.S. Census Bureau" | ||
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/> | ||
</gfc:FC_ListedValue> | ||
</gfc:listedValue> | ||
</gfc:FC_FeatureAttribute> | ||
</gfc:carrierOfCharacteristics> | ||
<gfc:carrierOfCharacteristics> | ||
<gfc:FC_FeatureAttribute> | ||
<gfc:memberName> | ||
<gco:LocalName>GEOID</gco:LocalName> | ||
</gfc:memberName> | ||
<gfc:definition> | ||
<gco:CharacterString>Nation identifier</gco:CharacterString> | ||
</gfc:definition> | ||
<gfc:cardinality gco:nilReason="unknown"/> | ||
<gfc:definitionReference xlink:title="U.S. Census Bureau" | ||
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/> | ||
<gfc:listedValue> | ||
<gfc:FC_ListedValue> | ||
<gfc:label> | ||
<gco:CharacterString>US</gco:CharacterString> | ||
</gfc:label> | ||
<gfc:definition> | ||
<gco:CharacterString>United States</gco:CharacterString> | ||
</gfc:definition> | ||
<gfc:definitionReference xlink:title="U.S. Census Bureau" | ||
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/> | ||
</gfc:FC_ListedValue> | ||
</gfc:listedValue> | ||
</gfc:FC_FeatureAttribute> | ||
</gfc:carrierOfCharacteristics> | ||
<gfc:carrierOfCharacteristics> | ||
<gfc:FC_FeatureAttribute> | ||
<gfc:memberName> | ||
<gco:LocalName>NAME</gco:LocalName> | ||
</gfc:memberName> | ||
<gfc:definition> | ||
<gco:CharacterString>Nation name</gco:CharacterString> | ||
</gfc:definition> | ||
<gfc:cardinality gco:nilReason="unknown"/> | ||
<gfc:definitionReference xlink:title="U.S. Census Bureau" | ||
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/> | ||
<gfc:listedValue> | ||
<gfc:FC_ListedValue> | ||
<gfc:label> | ||
<gco:CharacterString>United States</gco:CharacterString> | ||
</gfc:label> | ||
<gfc:definition> | ||
<gco:CharacterString>Nation</gco:CharacterString> | ||
</gfc:definition> | ||
<gfc:definitionReference xlink:title="U.S. Census Bureau" | ||
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/> | ||
</gfc:FC_ListedValue> | ||
</gfc:listedValue> | ||
</gfc:FC_FeatureAttribute> | ||
</gfc:carrierOfCharacteristics> | ||
</gfc:FC_FeatureType> | ||
</gfc:featureType> | ||
</gfc:FC_FeatureCatalogue> |
Oops, something went wrong.