MAPC / datacommon

MAPC's Data Portal
https://datacommon.mapc.org/
3 stars 0 forks source link

Shapefile Export broken for Zoning Atlas Dataset #366

Open mzagaja opened 3 years ago

mzagaja commented 3 years ago

Describe the bug When exporting the .shp for Zoning Atlas dataset, the Shapefile is 21KB and seems to contain no shapes.

Steps to reproduce Walk us through how you revealed the bug.

  1. Go to https://datacommon.mapc.org/browser/datasets/421
  2. Click on .shp
  3. Unzip the file.
  4. Open .shp in QGIS and note it lacks shapes.

Expected behavior We would expect to see spatial data. The .shp from SharePoint is about ~125MB.

mzagaja commented 3 years ago
ogr2ogr -lco ENCODING=UTF-8 -f 'ESRI Shapefile' export-zoning-atlas.shp PG:'' -sql 'SELECT *,sde.ST_AsText(shape) FROM mapc.zoning_atlas'
ERROR 1: ERROR:  function getsrid(cstring) does not exist
LINE 1: SELECT getsrid("st_astext") FROM(SELECT *,sde.ST_AsText(shap...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

ERROR 1: ERROR:  function getsrid(cstring) does not exist
LINE 1: SELECT getsrid("st_astext") FROM(SELECT *,sde.ST_AsText(shap...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Based on the log output above when running the raw command, this may be a permissions issue related to ArcSDE.

mzagaja commented 3 years ago

@hydrickg Do you think there might be a permissions issue with ArcSDE here not being able to access the getsrid function from ArcSDE? I am wondering if there is a place we can GRANT this permission to the viewer user to surmount this, or if there is another ArcSDE issue blocking access.

mzagaja commented 3 years ago

Tried version bumping ogr2ogr without luck on this.

mzagaja commented 3 years ago

Another potential differential is the functional tables have an index labeled as such:

image

Whereas zoning atlas only has:

image
mzagaja commented 3 years ago

Also noting that the same logging output occurs when you try exporting a non-broken GIS db:

datacommon@live-mapc-org:/var/www/datacommon/shared$ ogr2ogr -lco ENCODING=UTF-8 -f 'ESRI Shapefile' export-walking-trails.shp PG:'' -sql 'SELECT *,sde.ST_AsText(shape) FROM mapc.rpa_poly'
ERROR 1: ERROR:  function getsrid(cstring) does not exist
LINE 1: SELECT getsrid("st_astext") FROM(SELECT *,sde.ST_AsText(shap...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

ERROR 1: ERROR:  function getsrid(cstring) does not exist
LINE 1: SELECT getsrid("st_astext") FROM(SELECT *,sde.ST_AsText(shap...
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

I think we can be confident that whatever difference is occuring is not being logged.