Another option is to run the main method of OSMImport class, which expects
command line arguments for database location and OSM file, and will simply
import a file once. This is not tested often, so there is a risk things have
changed, but it is worth a try.

Another, even easier, option in my opinion is the JRuby gem,
neo4j-spatial.rb. See http://rubygems.org/gems/neo4j-spatial

To get this running, just install JRuby from http://jruby.org, and then
install the gem with "jruby -S gem install neo4j-spatial" and then you will
have new console commands like 'import_layer'. If you run 'import_layer
mydata.osm', it will import it to a new database, which you can use. See the
github page for more information:
https://github.com/craigtaverner/neo4j-spatial.rb

On Thu, Jul 7, 2011 at 10:47 AM, Peter Neubauer <
peter.neuba...@neotechnology.com> wrote:

> Robin,
>
> the database is deleted after each run in Neo4jTestCase.java,
>
>   @Override
>    @After
>    protected void tearDown() throws Exception {
>        shutdownDatabase(true);
>        super.tearDown();
>    }
>
> if you change to shutdownDatabase(false), the database will not be
> deleted. In this case, make sure to run just that test in order not to
> write several tests to the same DB for clarity.
>
> mvn test -Dtest=TestDynamicLayers
>
> Does that work for you?
>
>
> 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, Jul 5, 2011 at 6:07 PM, Robin Cura <robin.c...@gmail.com> wrote:
> > Hello,
> >
> > First of all, I don't know anything in java, and I'm trying to figure out
> if
> > neo4j could be usefull for my projects. If it is, I will of course learn
> a
> > bit of java so that I can use neo4j in a decent way for my needs.
> >
> > I'd like to use a neo4j spatial database together with GeoServer.
> > For this, I'm following the tutorial here :
> > http://wiki.neo4j.org/content/Neo4j_Spatial_in_GeoServer
> > But this paragraph is blocking me :
> > "
> >
> >   - One option for the database location is a database created using the
> >   unit tests in Neo4j Spatial. The rest of this wiki assumes that you ran
> the
> >   TestDynamicLayers unit test which loads an OSM dataset for the city of
> Malmö
> >   in Sweden, and then creates a number of Dynamic Layers (or views) on
> this
> >   data, which we can publish in GeoServer.
> >   - If you do use the unit test for the sample database, then the
> location
> >   of the database will be in the target/var/neo4j-db directory of the
> Neo4j
> >   Source code.
> >
> > "
> >
> > My problem is I do not succeed keeping those neo4j spatial databases
> created
> > with the tests : When I run TestDynamicLayers, it builds databases (in
> > target/var/neo4j-db), but as soon as the database is successfully loaded,
> it
> > deletes it and start importing another database, and so on.
> >
> > My poor understanding of java doesn't help a lot, I tried to edit the
> .java
> > in Netbeans + Maven, but until then, it doesn't work, all the directories
> > created during the tests are deleted when the test ends.
> >
> > Any idea how I could keep those databases ?
> >
> > Thanks,
> >
> > Robin
> > _______________________________________________
> > 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