thanks Tobias, it is working now, have been learning a lot abt jython and 
geo-neo4j lately :)

best,
sima

--- On Wed, 21/7/10, Tobias Ivarsson [via Neo4J User List] 
<[email protected]> wrote:

From: Tobias Ivarsson [via Neo4J User List] 
<[email protected]>
Subject: Re: [Neo4j] neo4j-spatial and jython
To: "sima" <[email protected]>
Date: Wednesday, 21 July, 2010, 9:29 AM



Your code has at least two (these are the obvious ones) issues:


1. You are trying to write Java in Python. This is Java:

ShapefileImporter importer = new ShapefileImporter(graphdb);

In Python you don't declare types, and you don't use 'new' to create new

instances.


2. You are mixing the python bindings with pure Java libraries.

Since the python bindings and neo4j-spatial don't have any knowledge about

each other you cannot use them together, you will have to use the pure Java

API for Neo4j instead of the python wrappers. Something like this:


from org.neo4j.kernel import EmbeddedGraphDatabase

from org.neo4j.gis.spatial import ShapefileImport

graphdb = EmbeddedGraphDatabase( GRAPH_STORE_DIR )

importer = ShapefileImporter(graphdb)

...


Cheers,

Tobias


On Wed, Jul 21, 2010 at 5:21 AM, sima <[hidden email]> wrote:


>

> so i have this jython code to import a shapefile using the

> ShapefileImporter

> in neo4j-spatial

> ------------------------------

> import sys

> import neo4j

> sys.path.append('home/sima/Downloads/neo4j-spatial/src/main/java/')

> from org.neo4j.gis.spatial import ShaefileImporter

>

> sys.path.append('home/sima/Downloads/neo4j-spatial/target/neo4j-spatial-0.1-SNAPSHOT.jar')

> graphdb =

> neo4j.GraphDatabase("sys.path.append('home/sima/Downloads/scripts/neo4j");

> ShapefileImporter importer = new ShapefileImporter(graphdb);

> #    importer.importShapefile("roads.shp", "layer_roads");

> graphdb.shutdown();

> -----------------------------

> but i got this error :

>

>  File "OSM2Neo4j.py", line 58

>    ShapefileImporter importer = new ShapefileImporter(graphdb);

>                     ^

> SyntaxError: mismatched input 'importer' expecting NEWLINE

> -------------------------

> im guessing it still can't recognize the ShapefileImporter  but i m not

> sure

> why? any one knows why?

>

>

> thanks,

> sima

> --

> View this message in context:

> http://neo4j-user-list.438527.n3.nabble.com/Neo4j-neo4j-spatial-and-jython-tp970428p983205.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.

> _______________________________________________

> Neo4j mailing list

> [hidden email]

> https://lists.neo4j.org/mailman/listinfo/user
>



-- 

Tobias Ivarsson <[hidden email]>

Hacker, Neo Technology

www.neotechnology.com

Cellphone: +46 706 534857

_______________________________________________

Neo4j mailing list

[hidden email]

https://lists.neo4j.org/mailman/listinfo/user






View message @ 
http://neo4j-user-list.438527.n3.nabble.com/Neo4j-neo4j-spatial-and-jython-tp970428p983357.html


To unsubscribe from Re: [Neo4j] neo4j-spatial and jython, click here.






-- 
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/Neo4j-neo4j-spatial-and-jython-tp970428p987485.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to