ThinkGeo.com    |     Blog    |     Wiki    |     Support

Convert ShapeFile to SQLite with New Coordinate

MapSuite Team,

I have a ShapeFileFeatureLayer in WGS84 DecimalDegree. I convert to an SQLiteFeatureLayer and attempt to project on-the-fly to EPSG3857, but the layer does not display.

Would you recommend that during the conversion to the SQLiteFeatureLayer the coordinate system be changed? Then there would be no need for an on-the-fly projection.

The ShapeFileFeatureLayer contains polygons.

Would you offer a few lines of code that shows how to change the coordinate system?

Thanks,
Dennis

MapSuite,

I’ve successfully converted the WGS84 ShapeFileFeatureLayer to SQLiteFeatureLayer that now renders properly.

What I did was to create a Projection on the ShapeFileFeatureLayer using the From & To coordinate systems below. Once the projection was assigned to the layer each feature from the ShapeFileFeatureLayer is read and then added as a new record to the SQLiteFeatureLayer.

When the SQLiteFeatureLayer is used the MapUnit is set to Meter and then it renders properly with EPSG3857.

Regards,
Dennis

From:

GEOGCS[“WGS84(DD)”, DATUM[“WGS84”, SPHEROID[“WGS84”, 6378137.0, 298.257223563]], PRIMEM[“Greenwich”, 0.0], UNIT[“degree”, 0.017453292519943295], AXIS[“Geodetic longitude”, EAST], AXIS[“Geodetic latitude”, NORTH]]

To:
PROJCS["NAD_1983_StatePlane_Illinois_East_FIPS_1201_Feet",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",984250.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-88.33333333333333],PARAMETER["Scale_Factor",0.999975],PARAMETER["Latitude_Of_Origin",36.66666666666666],UNIT["Foot_US",0.3048006096012192]]

Hi Dennis,

Thanks for your share. You’re right, set projection to FeatureSource.Projection can make the features from shape file converted to target projection.

Regards,

Ethan