Hi Peter,

the tests are running and now I get the following results:

cypher> start n=node:geom('bbox:[9.9996186, 9.9996186, 48.4027913,
48.4027913]')
cypher> return n
cypher> 
==> +------------------------------------------------------+
==> | n                                                    |
==> +------------------------------------------------------+
==> | Node[205373]{vertices->1,bbox->[D@4613e058,gtype->1} |
==> +------------------------------------------------------+
==> 1 rows, 194 ms

http> POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesInLayer
{"layer":"geom","minx":9.9996186,"maxx":9.9996186,"miny":48.4027913,"maxy":48.4027913}
 
==> 200 OK
==> [ {
==>   "outgoing_relationships" :
"http://localhost:7474/db/data/node/205373/relationships/out";,
==>   "data" : {
==>     "bbox" : [ 9.9996186, 9.9996186, 48.4027913, 48.4027913 ],
==>     "vertices" : 1,
==>     "gtype" : 1
==>   },
==>   "traverse" :
"http://localhost:7474/db/data/node/205373/traverse/{returnType}";,
==>   "all_typed_relationships" :
"http://localhost:7474/db/data/node/205373/relationships/all/{-list|&|types}",
==>   "property" :
"http://localhost:7474/db/data/node/205373/properties/{key}";,
==>   "self" : "http://localhost:7474/db/data/node/205373";,
==>   "properties" : "http://localhost:7474/db/data/node/205373/properties";,
==>   "outgoing_typed_relationships" :
"http://localhost:7474/db/data/node/205373/relationships/out/{-list|&|types}",
==>   "incoming_relationships" :
"http://localhost:7474/db/data/node/205373/relationships/in";,
==>   "extensions" : {
==>   },
==>   "create_relationship" :
"http://localhost:7474/db/data/node/205373/relationships";,
==>   "paged_traverse" :
"http://localhost:7474/db/data/node/205373/paged/traverse/{returnType}{?pageSize,leaseTime}";,
==>   "all_relationships" :
"http://localhost:7474/db/data/node/205373/relationships/all";,
==>   "incoming_typed_relationships" :
"http://localhost:7474/db/data/node/205373/relationships/in/{-list|&|types}"
==> } ]

To get to this point I have to follow exactly the following steps:

1. Create a new database
2. Run the OSMImporter and name the layer 'geom' (Cypher don't like "\ / :")
-> separate osmPath and Layername in importer
3. Start the server and call the following through HTTP:

http> POST /db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer
{"layer":"geom", "lat":"lat", "lon":"lon"}
==> 200 OK
==> [ {
==>   "outgoing_relationships" :
"http://localhost:7474/db/data/node/582567/relationships/out";,
==>   "data" : {
==>     "layer_class" : "org.neo4j.gis.spatial.osm.OSMLayer",
==>     "layerprops" : [ "FIXME", "TMC:cid_58:tabcd_1:Class",
"TMC:cid_58:tabcd_1:Direction", "TMC:cid_58:tabcd_1:LCLversion",
"TMC:cid_58:tabcd_1:LocationCode", "TMC:cid_58:tabcd_1:NextLocationCode",
"TMC:cid_58:tabcd_1:PrevLocationCode", "access", "addr:city",
"addr:country", "addr:housenumber", "addr:postcode", "addr:state",
"addr:street", "admin_level", "agricultural", "alt_name", "amenity", "area",
"asb", "atm", "backrest", "barrier", "bell", "bench", "bicycle",
"bicycle_parking", "boundary", "brand", "bridge", "building",
"building:cladding", "building:height", "building:levels", "building:roof",
"building:type", "building:use", "bus", "cables", "capacity",
"capacity:disabled", "class:bicycle", "collection_times", "covered",
"created_by", "crossing", "crossing_ref", "cuisine", "cutting", "cycleway",
"denomination", "denotation", "description", "destination", "detail",
"direction", "ele", "electrified", "email", "emergency", "fax", "fee",
"fixme", "foot", "frequency", "from", "gauge", "grade", "hgv", "highway",
"historic", "history", "horse", "hour_off", "hour_on", "incline", "int_ref",
"is_in", "junction", "landuse", "lanes", "layer", "leisure", "light", "lit",
"man_made", "material", "maxheight", "maxspeed", "maxspeed:source",
"maxweight", "moped", "motor_vehicle", "motorcar", "motorcycle",
"motorroad", "mtb:scale", "name", "natural", "network", "noexit", "note",
"note:de", "office", "oneway", "onkz", "openGeoDB:auto_update",
"openGeoDB:community_identification_number", "openGeoDB:is_in",
"openGeoDB:is_in_loc_id", "openGeoDB:layer", "openGeoDB:license_plate_code",
"openGeoDB:loc_id", "openGeoDB:name", "openGeoDB:sort_name",
"openGeoDB:version", "opening_hours", "operator", "park_ride", "parking",
"payment:coins", "payment:telephone_cards", "phone", "place", "postal_code",
"power", "power:type", "priority", "psv", "public_transport", "rail",
"railway", "recycling:clothes", "recycling:glass", "recycling:paper", "ref",
"ref:color", "religion", "restriction", "route", "sac_scale", "segregated",
"service", "shelter", "shop", "smoking", "smoothness", "source",
"source:lit", "source:maxspeed", "sport", "surface", "tactile_paving", "to",
"tourism", "tracks", "tracktype", "traffic_sign", "trail_visibility",
"tram", "tunnel", "type", "usability:skate", "vehicle", "vending",
"voltage", "waterway", "website", "wheelchair", "wheelchair:description",
"width", "wikipedia", "wires", "wood", "workrules", "wpt_description" ],
==>     "layer" : "geom",
==>     "geomencoder" : "org.neo4j.gis.spatial.osm.OSMGeometryEncoder",
==>     "ctime" : 1322660287742
==>   },
==>   "traverse" :
"http://localhost:7474/db/data/node/582567/traverse/{returnType}";,
==>   "all_typed_relationships" :
"http://localhost:7474/db/data/node/582567/relationships/all/{-list|&|types}",
==>   "property" :
"http://localhost:7474/db/data/node/582567/properties/{key}";,
==>   "self" : "http://localhost:7474/db/data/node/582567";,
==>   "properties" : "http://localhost:7474/db/data/node/582567/properties";,
==>   "outgoing_typed_relationships" :
"http://localhost:7474/db/data/node/582567/relationships/out/{-list|&|types}",
==>   "incoming_relationships" :
"http://localhost:7474/db/data/node/582567/relationships/in";,
==>   "extensions" : {
==>   },
==>   "create_relationship" :
"http://localhost:7474/db/data/node/582567/relationships";,
==>   "paged_traverse" :
"http://localhost:7474/db/data/node/582567/paged/traverse/{returnType}{?pageSize,leaseTime}";,
==>   "all_relationships" :
"http://localhost:7474/db/data/node/582567/relationships/all";,
==>   "incoming_typed_relationships" :
"http://localhost:7474/db/data/node/582567/relationships/in/{-list|&|types}"
==> } ]
http> POST http://localhost:7474/db/data/index/node/ {"name":"geom",
"config":{"provider":"spatial"}}
==> 201 Created
==> {
==>   "template" :
"http://localhost:7474/db/data/index/node/geom/{key}/{value}";,
==>   "provider" : "spatial"
==> }

4. Restart the server. You now have an spatial index 'geom and can do any
queries to the OSM data

The order is very important. If you first create the spatial index on the
database you get another encoder and it doesn't work afterwards with OSM
data. Once I got a lucene index back and not spatial, don't know what
happened there.

Regards Daniel



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Spatial-build-run-problems-tp3515519p3548339.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

Reply via email to