mapbox / node-wmshp

Reproject shapefiles to EPSG:3857 using node-gdal
ISC License
9 stars 5 forks source link

Tolerance condition error #1

Open rclark opened 9 years ago

rclark commented 9 years ago

Encountered this while reprojecting a shapefile with the following SRS:

PROJCS["NAD_1983_HARN_StatePlane_Michigan_South_FIPS_2113_Feet_Intl",
    GEOGCS["GCS_North_American_1983_HARN",
        DATUM["NAD83_High_Accuracy_Reference_Network",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["False_Easting",13123359.58005249],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",-84.36666666666666],
    PARAMETER["Standard_Parallel_1",42.1],
    PARAMETER["Standard_Parallel_2",43.66666666666666],
    PARAMETER["Latitude_Of_Origin",41.5],
    UNIT["Foot",0.3048]]

using ogr2ogr yields the same error:

ogr2ogr -t_srs epsg:3857 -f "ESRI Shapefile" ~/tmp/tolerance-condition-error.projected ~/tmp/tolerance-condition-error/finalhomicide.shp
ERROR 1: tolerance condition error
Failed to reproject feature 25 (geometry probably out of source or destination SRS).
ERROR 1: Terminating translation prematurely after failed
translation of layer finalhomicide (use -skipfailures to skip errors)
tmcw commented 9 years ago

Hitting the same thing with this datasource: https://data.cityofnewyork.us/Environment/Street-Tree-Census-Bronx-/bkyy-g74a

tmcw commented 9 years ago

message is coming from proj4

tmcw commented 9 years ago

proj4 triggers this error from a whole lot of places. projects.h shortcuts the errorcode with a macro:

#define F_ERROR { pj_ctx_set_errno( P->ctx, -20); return(xy); }

And then triggers it from all kinds of forward-projection Mercator code.

tmcw commented 9 years ago

Filed issue upstream: http://trac.osgeo.org/proj/ticket/272