On Mon, 12 Mar 2007 17:14:08 +0200, Jeroen van Dijk <[EMAIL PROTECTED]>  
wrote:

> Thanks for your help Teodor. I have looked into the JTS documentation
> and I know now how to create a point:
>
>       import com.vividsolutions.jts.geom.Coordinate;
>       import com.vividsolutions.jts.geom.CoordinateSequence;
>       import com.vividsolutions.jts.geom.GeometryFactory;
>       import com.vividsolutions.jts.geom.Point;
>       import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
>
>       Coordinate [] coordArr = {new Coordinate(51.594f, 4.777f) };
>       CoordinateSequence cs = new CoordinateArraySequence( coordArr );
>
>       GeometryFactory factory;
>       Point point = new Point(cs,  new GeometryFactory() );
>
>
> However, this point is not compatible with the GeoTools Point interface
> because this is based on the  OpenGis interface and JTS Point class
> doesn't implement this. So how can I used this Point object with the
> Geotools library to make selection in a shapefile?
>
> Sorry for these questions but it is just not clear to me.
>
> Regards,
> Jeroen

Hi Jeroen,

unfortunately I don't know the answer to your question
because I have just started using GeoTools myself, and
I am focusing for the moment on the rendering of maps.

However I don't understand where do you need to use other
geometries than the JTS ones. Until now, I have only needed to
use JTS geometries. For example when you read each feature of a
shapefile, and call "getDefaultGeometry()" on a Feature, this will
return a JTS Geometry instance, on which you can apply all sorts
of geometry operations (intersection, etc)

Maybe if you would submit the code that asks for an OpenGIS point,
someone on this list could help you out.

Best regards,
Teodor

>
> -----Original Message-----
> From: Teodor BACIU [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 12, 2007 2:34 PM
> To: Jeroen van Dijk; [email protected]
> Subject: Re: [Geotools-gt2-users] GeometryFactory for a circle?
>
> On Mon, 12 Mar 2007 15:18:54 +0200, Jeroen van Dijk <[EMAIL PROTECTED]>
>
> wrote:
>
>> Maybe, a silly question, but I still haven't solved my previous posted
>> problem. My problems start quite basic: How do I create a point
>> Geometry?
>>
>> I guess I'm missing some basic knowledge of the API, but the tutorials
>> do not help me here either.
>>
>
> Hi,
>
> Geotools is using for geometry operations the JTS
> API, developped by Vivid Solutions. You will have
> to familiarize yourself with this API first.
>
> As a start point you can check the following section
>  from the GeoTools tutorials:
>
> http://geotools.codehaus.org/Working+with+JTS+Geometries+from+DataStores
>
> Best regards,
> Teodor
>
>>
>> -----Original Message-----
>> From: Ian Turton [mailto:[EMAIL PROTECTED]
>> Sent: Friday, March 09, 2007 10:10 PM
>> To: Jeroen van Dijk
>> Cc: [email protected]
>> Subject: Re: [Geotools-gt2-users] GeometryFactory for a circle?
>>
>> On 3/9/07, Jeroen van Dijk <[EMAIL PROTECTED]> wrote:
>>>
>>
>>>
>>> I want select roads, from a shapefile, with a certain radius from a
>> point,
>>> thus lying in a circle.
>>>
>>>
>>>
>>> I found this link that shows how to select point with a polygon.
>>>
>>> http://www.nabble.com/filter-points-within-polygon-t2740648.html
>>>
>>>
>>>
>>> My only problem is now to create a Geometry that represents a circle.
>> Like
>>> in the post of
>>
>> What you really want is a DWithin filter which gives you everything
>> within a distance of a geometry (in your case a point).
>>
>> Ian
>
>
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to