Quoting Scott Pezanowski <scottpez@anonymised.com>:
Hi,
I am trying to create a Datastore for the database Secondo:
http://www.informatik.fernuni-hagen.de/secondo/content_downloads.html
In the Datastore walkthrough PropertyAttributeReader it tries to
parse the
resulting Geometry using
return type.getAttributeType(index).parse(text[index]);
with text[index] being the geometry in WKT. What should I do to
convert the
Secondo geometry type to a form Geotools needs? Currently, the
geometry is
in a object called DsplGraph. One of its methods returns a
java.awt.Shape if
you provide an AffineTransform:
/**
* The actual shape of the object. May be null if drawn by itself.
* @param af The transformation under which this shape will be drawn
* @return momentary shape object
*/
public Shape getRenderObject (AffineTransform af);
Is this what I should be looking at? What format am I trying to get
the
geometry into (format for Geomtry I should return from
PropertyAttributeReadert.read())?
You're trying to get it into a JTS Geometry. See
http://www.vividsolutions.com/jts/jtshome.htm You should be able to use
their Geometry Factory methods, check the javadocs. You'll probably
want to get the coordinates and type from the Shape, and change it into
the appropriate JTS object. This is what our Geometric AttributeTypes
expect, you do not need to use the parse method. If you need more
directions on how to do this let me know, but the JTS docs are pretty
good, and you should be able to figure out what to construct where.
And actually, you may consider abstracting out the Shape -> JTS
converter - other datastores in the future may have a need for it.
This example does point to the downside of using JTS directly - we have
been wanting to change to interfaces for our Geometries for awhile.
You'll get some extra overhead in the conversion to JTS, which is lame
in this case since it already implements Shape, which is more
appropriate for rendering (just less appropriate for topology
operations, which are not always required).
Hope this helps,
Chris
Thanks for any help you can provide,
Scott
<html><DIV>
<DIV>********************************************* </DIV>Scott
Pezanowski
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>email: scottpez@anonymised.com
<DIV></DIV>*********************************************</DIV></html>
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/