wahy neo4j spatial Layer layer = db.getLayer("layer-hot-point") is versy slow?

59 views
Skip to first unread message

杨军

unread,
Aug 13, 2012, 3:24:30 AM8/13/12
to ne...@googlegroups.com
neo4j spatial ,about 20 layers, Layer layer = db.getLayer("layer-hot-point") is versy slow.

 Layer layer = db.getLayer("layer-hot-point");  // take a long time
 logger.info("type = " + layer.getGeometryType());

--
Best regards,
yang jun
Tel: 028-85126877
Mob: 18608027881 <mailto:yangjun...@gmail.com>
Chat: yangjun...@gmail.com(gtalk)

Peter Neubauer

unread,
Aug 13, 2012, 10:00:03 AM8/13/12
to ne...@googlegroups.com
Hi there,
how much data is in that layer? This should be pretty fast normally.
Otherwise, we might want to make the fetching of the layer lazy, and
not fetch the underlying data when you just request the layer data.

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.

Craig Taverner

unread,
Aug 13, 2012, 12:12:44 PM8/13/12
to ne...@googlegroups.com
If I remember correctly the original design was lazy. It only loaded meta-data. However, I see that he says it is slow when there are many layers, not when there are big layers. Even then, the meta-data is loaded with a very short traversal, so this should be fast. I can only assume there is some kind of bug with it doing unnecessary traversals in searching for the layer, and loading meta-data for all known layers.

A test case would be good to track this down.

杨军

unread,
Aug 13, 2012, 9:15:19 PM8/13/12
to ne...@googlegroups.com
layer date shape file import, feture size 3,965,643

2012/8/14 Craig Taverner <cr...@amanzi.com>

杨军

unread,
Aug 13, 2012, 10:10:43 PM8/13/12
to ne...@googlegroups.com
debug code,  Layer layer = db.getLayer("layer-hot-point");

.....


finally,execute
   // index must be created *after* geometryEncoder
        this.index = new LayerRTreeIndex(spatialDatabase.getDatabase(), this);


why shape file import layer, rebuild RTreeIndex?


2012/8/14 杨军 <yangjun...@gmail.com>

Jonathan D'Orleans

unread,
Jun 14, 2013, 3:44:10 PM6/14/13
to ne...@googlegroups.com
Hello guys,

I'm trying out the neo4j spatial api.

I have made the following:

1. I have imported a whole Brazil shape files using the ShapefileImporter. Everything gone ok.

2. I'd like to create a new database of points. So I have to read the first database (imported from shapes) and covert the geometries into points.
2.1. In order to do that I need to use the db.getLayer("myLayer") and then read all geometries etc. Here is my problem.

I'd like to know why getLayer is taking too long and recreating the RTreeIndex?

Is there any other way to create a spatial database of points from an imported shape file database ?

Thx,


2012/8/14 杨军 <yangjun...@gmail.com>



--
Best regards,
yang jun
Tel: 028-85126877
Mob:  18608027881 <mailto:yan...@gmail.com>
Chat: yangjun...@gmail.com(gtalk)

Peter Neubauer

unread,
Jun 17, 2013, 8:10:59 AM6/17/13
to Neo4j User
Hi there,
do you have the code position somewhere? If we remove the rebuilding, what happens to the tests? This might be something that is not needed anymore.

/peter


Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Kids in Malmö this summer?       - http://www.kidscraft.se
Neo4j questions? Please use SO - http://stackoverflow.com/search?q=neo4j
Reply all
Reply to author
Forward
0 new messages