Re: [Neo4j] Mapping domain graph to spatial layer

2011-10-16 Thread Peter Neubauer
Marcin,
in the case of points, maybe the creation of the bbox property could
be done automatically, I wil raise an issue around this. Otherwise,
let us know how things are progressing for you, always good to get
feedback!

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Sat, Oct 15, 2011 at 4:50 PM, Marcin Zpa se...@vp.pl wrote:
 Hi Peter,
 thank you very much! for a very detailed description. Know i understand it
 very good. The chunk of information which i was missing is fact that the
 node being added has to have bbox property in order to be indexed by spatial
 layer. Know it is clear to me. Once again thanks a lot and of course keep
 the pace! Spatial neo4j is great!

 Cheers, Marcin

 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Mapping-domain-graph-to-spatial-layer-tp3409159p3424089.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 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


Re: [Neo4j] Mapping domain graph to spatial layer

2011-10-15 Thread Marcin Zpa
Hi Peter,
thank you very much! for a very detailed description. Know i understand it
very good. The chunk of information which i was missing is fact that the
node being added has to have bbox property in order to be indexed by spatial
layer. Know it is clear to me. Once again thanks a lot and of course keep
the pace! Spatial neo4j is great! 

Cheers, Marcin

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Mapping-domain-graph-to-spatial-layer-tp3409159p3424089.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Mapping domain graph to spatial layer

2011-10-13 Thread Peter Neubauer
Marcin,
look at 
https://github.com/neo4j/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestSimplePointLayer.java#L42
where data is added to the SimplePointLayer, specifying that the
lat/lon should be encoded into Longitude/Latitude properties on the
geometry node.

For adding existing data to the layer, look at
https://github.com/neo4j/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/server/plugin/SpatialPlugin.java#L98
- you are adding an existing node with the right lon/lat properties to
the layer, using the specified GeometryEncoder at Layer setup time.

I did an example of this in the functional tests, see
https://github.com/neo4j/spatial/blob/master/features/start-and-stop.feature#L10
where a layer is created (assuming lon/lat/bbox per default as the
geometry nodes properties to be used for indexing, then a raw node is
created, then the nodes is added to the layer and indexed, and then
you can search for it in different permutations (REST, Gremlin,
Cypher, Neo4j Index)

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Tue, Oct 11, 2011 at 6:59 PM, Marcin Zpa se...@vp.pl wrote:
 Hi Peter,
 thanks a lot for your quick feedback. What do you mean with skipping
 encoding step? That means that i could directly index my domain
 coordinate node and do not create any additional geo nodes. Sorry if
 you find this question stupid or obvious but i cant follow your
 suggestion. For me important thing is that after invoking search i
 want to somehow get back from results provided as
 SpatialDatabaserecord to domain nodes as for example user.

 Thanks in advance!


 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Mapping-domain-graph-to-spatial-layer-tp3409159p3413184.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 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] Mapping domain graph to spatial layer

2011-10-10 Thread Marcin Zpa
Hi guys,
i think my question is pretty simple, but since i cannot find anything
in network about it i decided to ask you. I'm using SDG with
cross-store functionality. I have users which are persisted in the
relational database. User has Address and Address is stored in Neo4j.
Going further Address has Coordinates  which are saved in neo and
connected with address through ADDRESS_LOCATION. First question is if
this way of persisting objects is correct, perform ok and make sense
(suggestion ware welcomed). In the future i will have also many routes
which i want to save in neo as well. Since i want to give users
possibility to find each others and to finds routes in their
neighborhood i decided to use neo4 spatial (another reason was
curiosity of trying something new ;) and now comes the proper
question. How should i map my address coordinates to be able to use
them for spatial queries. As for now I am using SimplePointEncoder and
EditableLayer. I transform my domain coordinates object to coordinate
object from geotool plus i pass property nodeId with the id value of
coordinate node which has relationship to address. Once I get results
from the search within distance, i transform SpatialDataRecord back to
my coordinates using saved nodeId and finding them by id. Once I
have coordinates node i traverse it get Address node. This approach
seems over-complicated to me and i am convinced there is better way of
doing it. I was thinking about creating relationship between domain
coordinates and geo node from neo4j spatial. I tried it out with
changing implementation of EditableLayer and adding one line after
invocation of the method addGeomNode which connect these two but i
guess that geo layer should stay isolated from domain that is why i
resigned from it. How would i do it in the best way? Does whole this
approach with cross-store make sense in this case?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Mapping-domain-graph-to-spatial-layer-tp3409159p3409159.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user