Hi Rick,

I see Peter already responded, but I thought I could comment on a few
specific questions you had.

I can also start up geoserver, and it connects without complaint to my
> neo4j database via the "file:" interface.  Unfortunately it doesn't see
> anything in it.
>

In the wiki page on Neo4j in
Geoserver<http://wiki.neo4j.org/content/Neo4j_Spatial_in_GeoServer>nothing
is said about how to get spatial data into the database. That is
kind of left up to you, because how it is done is very dependent on your
data and needs. The sample used in that wiki page actually expects you to
run one of the unit tests build into Neo4j Spatial, which will populate the
database with sample spatial data. Those unit tests also include sample code
for importing ESRI Shapefile and OSM files into the database, as well as
supporting your own simple formats. As far as the sample code is concerned,
for Shapefile we support all geometries, for OSM only LineString and Polygon
currently. For the simple formats only Point and LineString. But the
database supports all formats, so you can easily add whatever you want.

I have my raw data in various formats, including a geojson file.  I tried
> just adding the geojson structure as a node, but that didn't work...
>

Well, the current code does not have an adapter for GeoJSON to JTS Geometry.
We have considered adding one, since it would be quite easy. In essence, any
node or graph structure you can think of that is spatial can have an adapter
added to the database to allow conversion to and from JTS Geometries, and
therefor be read and written to the database.

I'm still really unclear as to how to get my data into a layer in neo4j
> (preferably using the REST interface) that will be recognized by
> geoserver.
>

The code Peter added to get Neo4j Spatial into the REST server was really a
stub. It just proved the point and implemented the API's. Last week I
updated it slightly so that it actually adds points to the layer, but this
is not really tested yet. However, since all the underlying capabilities
work in through the normal Java API, adding more features to the REST
wrapper will not be a big issue. But just be aware that the REST wrapper for
the spatial code is definitely only just a beginning. If you want to make
use of Neo4j Spatial now, it would be better to use the Java API.

I'm guessing that first you can create an empty "layer".  In your example
> below, is that what you are doing?  What do you mean by "returns the
> original node"?
>

In Peters original code, there was one method that created an empty layer
(if was called addNodeToLayer, but actually did not add the node). As I
mentioned before it was a stub Peter put in place for someone else (me) to
fill in the gaps. Last weeks updates' split this to two methods, one to
create an empty layer and another to add nodes to it. But this should be
seen really as a work in progress.

I suppose a single neo4j instance can have multiple independent layers in
> it.  Is that true?
>

Certainly. Both multiple independent layers as well as multiple *dependent*
layers. By this I mean that you can have layers that map onto the same
internal graph. This is how we deal with Open Street Map data, which is one
big complex graph, can can still be viewed as multiple layers. When the
layers are independent, they each have their own index (and coordinate
system, or projection), but if they are dependent they all share index and
coordinate system.

Your example layer appears to be titled "buildings".  Does that mean it
> will contain the shapes of buildings, or the point locations of buildings
> (or both)?  How do you add a 'building' (of either type) to the layer?
> I'm assuming your example does not add any buildings because there is no
> discernible location information in the data below.
>

Peter was demonstrating how it *could* work, but it did not work yet. It was
a stub.

My locations are all defined by latitude/longitude pairs.  At the moment
> I'd like to start by adding simple "points" in a layer.  Eventually I'd
> like to add edges and shapes, but I'd be really happy just to be able to
> get points mapped first.
>

I mentioned before about creating adapters to the data model. Well, it
turned out that despite the built in support for complex geometries we have
for SHP and OSM, we did not have an adapter for exactly the storage Peter
was pushing for with his stub. He wanted a node that had two properties, a
lat and a long. We had code for supporting the Point as a WKB property, or
as a double[] of coordinates, but not one for two properties. So I caved and
wrote one last week. See
https://github.com/neo4j/neo4j-spatial/blob/master/src/main/java/org/neo4j/gis/spatial/encoders/SimplePointEncoder.java

But this was only to satisfy Peter's implied request to store the point as
two properties (as implied by his method in the rest api). So, in fact
Peters stub was a feature request ;-)

aTdHvAaNnKcSe !
>

IhHeOlPpEeIdT
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to