Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to publish new layer for type "neo4j" #3

Open
nikolauskrismer opened this issue Nov 21, 2013 · 5 comments
Open

Question: How to publish new layer for type "neo4j" #3

nikolauskrismer opened this issue Nov 21, 2013 · 5 comments

Comments

@nikolauskrismer
Copy link
Contributor

I was wondering if it is possible to create a new layer for a neo4j datastore.
By now I am able to create the workspace and the datastore for neo4j (and I am also able to activate it)... but when it comes to layer creation I still need the webgui.

There I can easily click "create new layer" select my "Neo4J datastore" and publish my datafile (which looks something like "/opt/ibk-20131101.osm"). After that I can give the published layer a name, select the EPSG:4326 as reference system and activate the layer with line style.

How would I do that with geoserver-shell?

@jericks
Copy link
Owner

jericks commented Nov 23, 2013

I plan on updating the docs this weekend, but you will need to

  1. Create datastore
datastore create --workspace topp --name h2test --connectionParams "dbtype=h2 database=test.db"
  1. Publish a featuretype
featuretype publish --workspace postgis --datastore tables --featuretype table

I hope this helps!

@jericks jericks closed this as completed Nov 23, 2013
@nikolauskrismer
Copy link
Contributor Author

This seems to work for postgis, but not for neo4j
I always get a "false" as result

Is there any log (or something similar) where I can get some more details?

@jericks
Copy link
Owner

jericks commented Nov 28, 2013

Sorry, if you are getting false it means something is not working correctly. I just added some verbose logging to the feature type commands. Turn verbose logging on

geoserver verbose set --value true

and then give it a try. I don't have Neo4J set up and have never used it before (but it looks pretty cool) so it's hard to debug. I would suggest using curl form the command line using the correct url and xml doc

http://docs.geoserver.org/stable/en/user/rest/api/featuretypes.html

and then looking at the raw response and maybe looking at the geoserver logs. I really appreciate your help and persistence.

@jericks jericks reopened this Nov 28, 2013
@nikolauskrismer
Copy link
Contributor Author

Thanks to the verbose mode my understanding of geoserver's rest interface is a bit better now 👍

However, I still can not create the layer I want to create.
My call looks like this:

featuretype publish --workspace isochrone  --datastore Neo4J --featuretype /opt/innsbruck-131101-filtered.osm

My response looks like this

URL: http://localhost:8080/geoserver/rest/workspaces/isochrone/datastores/Neo4J/featuretypes.xml
Data: <featureType><name>/opt/innsbruck-131101-filtered.osm</name></featureType>
Response: null

As I got interested in the xml format I also tried to create the layer I want in the geoserver's webinterface and to see what happened. After creating the layer I can do the following:

featuretype list --workspace isochrone --datastore Neo4J

The reponse for this command is:

URL: http://localhost:8080/geoserver/rest/workspaces/isochrone/datastores/Neo4J/featuretypes.xml?list=configured
Response: <featureTypes>
  <featureType>
    <name>/opt/innsbruck-131101-filtered.osm</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/isochrone/datastores/Neo4J/featuretypes/%2Fopt%2Finnsbruck-131101-filtered.osm.xml" type="application/xml"/>
  </featureType>
  <featureType>
    <name>ibk_neo4j</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/isochrone/datastores/Neo4J/featuretypes/ibk_neo4j.xml" type="application/xml"/>
  </featureType>
</featureTypes>
/opt/innsbruck-131101-filtered.osm
ibk_neo4j

Interesting is that the following command leads to a NullPointerException (not sure why):

featuretype get --workspace isochrone --datastore Neo4J --featuretype ibk_neo4j

@nikolauskrismer
Copy link
Contributor Author

I fixed the NullPointerException when using "featuretype get" (see my pull request #5), but I am still not sure where the problem is...

...when creating the featuretype the geoserver's log contains a "schema creation not supported" so I guess my specified schema is not correct...
...when using "featuretype publish" without the create before I get a file not found (which I guess is related to the name of the featuretype "/opt/innsbruck-131101-filtered.osm" and that it contains slashes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants