Bryce,
are you looking for some kind of "snapping" to the nearest geometry? I
was doing something like that, Craig did a test on that, see
https://github.com/neo4j/neo4j-spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestSpatialUtils.java#L53,
there is some basic support for that in

SpatialTopologyUtils.java.

Does that help to get started? Feel free to add more utilities and
maybe a routing example, when you get it working.

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Tue, Jan 18, 2011 at 5:50 AM, bryce hendrix <brycehend...@gmail.com> wrote:
> Craig,
>
> I've ran into a bit of a stumbling block. I am attempting to do find a
> simple route using A* from 2 nodes on 2 different ways. What is the best way
> to find the points closest to 2 reference points which are on ways? Assuming
> I've got those nodes, is there anything special I have to do, other than
> setting up the estimate and cost evaluators?
>
> If I can figure this out, I'll submit my example back to you guys. I'm
> excited about this stuff, but I seem to be discovering the limits of the
> docs.
>
> Bryce
>
> On Sun, Jan 16, 2011 at 7:11 PM, Craig Taverner <cr...@amanzi.com> wrote:
>
>> Great that they all work :-)
>>
>> Good luck with the rest of the project and keep us posted, we're interested
>> in any feedback on the API.
>>
>> (getting lat/long mixed up is one of those things we all keep doing, I'm
>> pretty sure I did it once as recently as last month ... ;-)
>>
>> On Sun, Jan 16, 2011 at 11:52 PM, bryce hendrix <brycehend...@gmail.com
>> >wrote:
>>
>> > Craig, Peter,
>> >
>> > Its useful if I get the latitude and longitude in the correct order for
>> the
>> > Point. Ugh. I've found
>> > that SearchPointsWithinOrthodromicDistance, SearchClosest,
>> > and SpatialTopologyUtils.findClosestEdges all work for me. Looks like my
>> > project is well on its way now, thanks for the help.
>> >
>> > Bryce
>> >
>> > On Sun, Jan 16, 2011 at 3:16 PM, Craig Taverner <cr...@amanzi.com>
>> wrote:
>> >
>> > > The SearchPointsWithinOrthodromicDistance basically does a search on a
>> > > rectangular bounding box, and then inside the result set filters by
>> > > distance
>> > > from the center. The filter probably works only on points as implied by
>> > the
>> > > class name.
>> > >
>> > > The SpatialTopologyUtils class has a method findClosestEdge, which will
>> > do
>> > > what you are looking for. If you call it without a distance value, it
>> > will
>> > > take 1% of the total span of your layer as the search window, so if
>> this
>> > > does not make sense for your data (eg. your layer covers a small area,
>> as
>> > > you hinted at), then pass in the distance in units of the coordinate
>> > system
>> > > of the layer (probably WGS84, degrees, if you are using only OSM data).
>> > Try
>> > > it out and let us know.
>> > >
>> > > See:
>> > >
>> > >   -
>> > >
>> > >
>> >
>> https://github.com/neo4j/neo4j-spatial/blob/master/src/main/java/org/neo4j/gis/spatial/SpatialTopologyUtils.java
>> > >   -
>> > >
>> > >
>> >
>> https://github.com/neo4j/neo4j-spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestSpatialUtils.java
>> > >
>> > >
>> > > On Sun, Jan 16, 2011 at 11:19 AM, Peter Neubauer <
>> > > peter.neuba...@neotechnology.com> wrote:
>> > >
>> > > > Bryce,
>> > > > I think (Craig, correct me if I'm wrong) you need to have a Point
>> > > > layer to be able to do that search. The default OSM layer is
>> > > > containing a lot of geometries, so I think you first should define a
>> > > > layer on top of the full imported one, then search. I did something
>> > > > like that in another spike, see
>> > > >
>> > > >
>> > >
>> >
>> https://github.com/popdevelop/snapplr/blob/master/server_java/src/main/java/com/geosnappr/TaginfoImporter.java#L312
>> > > >
>> > > > The layer is defined with something like
>> > > >
>> > > >
>> > >
>> >
>> https://github.com/neo4j/neo4j-spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java#L26
>> > > > on top of the imported full data layer.
>> > > >
>> > > > Does that help?
>> > > >
>> > > > Cheers,
>> > > >
>> > > > /peter neubauer
>> > > >
>> > > > GTalk:      neubauer.peter
>> > > > Skype       peter.neubauer
>> > > > Phone       +46 704 106975
>> > > > LinkedIn   http://www.linkedin.com/in/neubauer
>> > > > Twitter      http://twitter.com/peterneubauer
>> > > >
>> > > > http://www.neo4j.org               - Your high performance graph
>> > > database.
>> > > > http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
>> > party.
>> > > >
>> > > >
>> > > >
>> > > > On Sat, Jan 15, 2011 at 10:58 PM, bryce hendrix <
>> > brycehend...@gmail.com>
>> > > > wrote:
>> > > > > I'm pretty new to neo4j, so please excuse me if this is a FAQ.
>> > > > >
>> > > > > I exported OSM data for a city from the OSM site, then imported it
>> > > using
>> > > > the
>> > > > > OSMImporter. I can see the layer via the webserver, so I know if
>> got
>> > > > > imported okay. Now I would like to find the way nearest to a
>> > coordinate
>> > > > via
>> > > > > the Java API, but I'm not really sure how to do that. I've tried
>> > using
>> > > > > SearchPointsWithinOrthodromicDistance, but the results of the query
>> > are
>> > > > > always empty. Can someone give me some tips, or provide a simple
>> > > example?
>> > > > >
>> > > > > Thanks in advance,
>> > > > > Bryce
>> > > > > _______________________________________________
>> > > > > Neo4j mailing list
>> > > > > User@lists.neo4j.org
>> > > > > https://lists.neo4j.org/mailman/listinfo/user
>> > > > >
>> > > > _______________________________________________
>> > > > Neo4j mailing list
>> > > > User@lists.neo4j.org
>> > > > https://lists.neo4j.org/mailman/listinfo/user
>> > > >
>> > > _______________________________________________
>> > > Neo4j mailing list
>> > > User@lists.neo4j.org
>> > > https://lists.neo4j.org/mailman/listinfo/user
>> > >
>> > _______________________________________________
>> > Neo4j mailing list
>> > User@lists.neo4j.org
>> > https://lists.neo4j.org/mailman/listinfo/user
>> >
>> _______________________________________________
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to