[postgis-users] WKT - Exponential Coordinates
Randy How
rhow at i3.com
Mon May 1 13:49:40 PDT 2006
Well I think I've basically figured this out. Unless someone
hollers...."NOOO!!!"
Geotools.IO.GeometryWKBReader wkbReader = new Geotools.IO.GeometryWKBReader(
new Geotools.Geometries.GeometryFactory(
new Geotools.Geometries.PrecisionModel(),
4326));
Geotools.Geometries.Geometry geom =
wkbReader.Create((byte[])cmd.ExecuteScalar());
Using GeoTools GeometryWKBReader and PostGIS AsBinary() creates the GeoTools
geometry.
Randy
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Randy
How
Sent: Monday, May 01, 2006 1:55 PM
To: 'PostGIS Users Discussion'
Subject: [postgis-users] WKT - Exponential Coordinates
I'm executing an intersection in PostGIS 1.1.0 using WKT input multipolygon
geometries. The WKT result coordinates have exponential values (i.e.
28.110482 -1e-06,28.9210135294118 -1e-06,29.7315450588235 -1e-06). One side
of the input multipolygons is the equator.
Here's the code -
private com.vividsolutions.jts.geom.Geometry _jtsProductCoverage = null;
string sqlIntersection = "select AsText(Intersection(GeometryFromText('" +
wktAOI + "',4326),geometry)) " +
"from coverage " +
"where product_id = " + this.Product_id + ";";
// Convert the Product Coverage to JTS geometry string wktProductCoverage =
(new DataAccess()).ExecuteScalar(sqlIntersection);
_jtsProductCoverage = JTSHelper.WKTGeometryToJTSGeometry(wktProductCoverage,
4326);
Presently the results are inputs to the JTS.WKTReader for succeeding
procedures, but the exponential values are throwing an exception in the
WKTReader.
Ideally I'd like to eliminate the WKTReader results conversion. FYI - I'm
writing this in C#. I'm wondering what the best option is to transfer the
geometries from PostGIS binary to JTS/GeoToolsNet geometries.
If anyone has any input/feedback/examples, I'd greatly appreciate it.
Thanks, Randy
Geospatial Applications Developer
Web: www.i3.com
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list