mharnold / spiderosm

Spider Open Street Matcher: GIS street network matching library
MIT License
27 stars 3 forks source link

Writing to spatialite causes crs mismatch #8

Closed AsgerPetersen closed 9 years ago

AsgerPetersen commented 9 years ago

It seems that geometries are written to spatialite in their native coordinate reference system (for instance UTM), but in spatialite they are assigned wgs84

mharnold commented 9 years ago

Thanks for the bug report!

I reproduced the problem (with spiderosm_portland.py) and will look into it.

mharnold commented 9 years ago

Fixed. (As of v0.4.0) Note: this requires use of the new spiderosm SRS object:

spatial reference system

srs = spiderosm.spatialref.SRS(
        url="http://www.spatialreference.org/ref/epsg/wgs-84-utm-zone-10n/",
        units='meters',
        spatialite_srid=spiderosm.config.settings.get('spatialite_srid'),
        postgis_srid=spiderosm.config.settings.get('postgis_srid')
        )
spiderosm.log.info('srs info:\n%s', srs.info()

... db = spiderosm.spatialite.Slite(sqlite_fn, srs=srs)

See spiderosm_berkeley.py and README.md for details.