Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShapefileStreamProviderRegistry does ProjectionStream get used? #29

Open
mattfung opened this issue Jan 18, 2020 · 4 comments
Open

ShapefileStreamProviderRegistry does ProjectionStream get used? #29

mattfung opened this issue Jan 18, 2020 · 4 comments

Comments

@mattfung
Copy link

Hello, Thanks for open sourcing this library.

I've been trying to open a shapefile in memory via ShapefileStreamProviderRegistry. The shapefile has .prj file, but the resultant ShapefileDataReader does not seem to have the CRS info present in the projection file. In fact, the Geometry field of the ShapefileDataReader instance is null (opening the shapefile using filepath also created a datareader with null geometry as well).

Browsing through the source code, I'm not able to find a place where ProjectionStream field of the StreamProviderRegistry is used, I'm wondering if the projection stream is read when opening the file?

Best,

@mattfung
Copy link
Author

mattfung commented Jan 20, 2020

Test file:

issue_29_sample.shp.zip

When running the following:

var geomFactory = new GeometryFactory();
var shapeFileLocal = new ShapefileDataReader(SHP_PATH, geomFactory);

shapeFileLocal has a null geometry field. As well, the attribute has SRID=0.


ogrinfo of the shape file returns:

INFO: Open of `issue_29_sample.shp'
      using driver `ESRI Shapefile' successful.

Layer name: issue_29_sample
Metadata:
  DBF_DATE_LAST_UPDATE=2020-01-20
Geometry: Polygon
Feature Count: 1
Extent: (618170.544319, 5124782.085875) - (618348.422460, 5124959.936131)
Layer SRS WKT:
PROJCS["WGS_1984_UTM_Zone_18N",
    GEOGCS["GCS_WGS_1984",
        DATUM["WGS_1984",
            SPHEROID["WGS_84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-75],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1],
    AUTHORITY["EPSG","32618"]]
Field1: String (50.0)
Field2: String (50.0)

which shows projection information

Assistance will be appreciated.

@kjeremy
Copy link

kjeremy commented Apr 3, 2020

I am seeing something similar. If I use a ShapeDataReader though I can get at the geometry but can't find anything about the projection. Did you solve this?

@mattfung
Copy link
Author

mattfung commented Apr 6, 2020

@kjeremy Nope, I wasn't framework bound so ended up using python (fiona + geoalchemy)..

@KubaSzostak
Copy link
Member

Hi @mattfung, do you need more support on this issue? If so, provide further details, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants