Hi Craig, first, thanks a lot for your comprehensive and helpful answer with a number of useful thoughts in it.
> Your original description says two things of interest, there is a GeoJSON > document for all countries (as multi-polygons) and there is an existing > neo4j database of all CMS data. I'm not sure what you mean by CMS data? Is > this an unrelated content management system, and so you are only saying that > you have exerience with neo4j in general, or is this data you wish to use in > a spatial context (together with the world map)? The CMS part is the core of the project containing pages, images and other entities needed for etc.. The content tree is stored as nodes and relationships in neo4j, so yes, there's some experience with neo4j. The CMS uses Freemarker as template engine and XPath queries to access nodes. Adding neo4j spatial to the picture should enable the CMS handling geo data objects without adding to much complexity (I hope). > In the former case, I guess > we are only talking about a GeoJSON importer, in the later we are talking > about using Neo4j Spatial to expose spatial information in your existing > database, which is a good use case for Neo4j Spatial, so would be good to > do. Either way, I think the job is not too big. > > For the GeoJSON importer, you could write a generic importer supporting the > full GeoJSON spec, or you could write one specific to your case of only > processing multi-polygons for countries. For the generic importer I'm not sure that my GIS knowledge is sufficient, so probably I'll start with the multi-polygon. > Another factor to consider, if you model your importer on the code in the > shapefile importer, you will create a database structure somewhat > reminiscent of postgis, with each geometry saved as a WKB blob in a node of > the database. In this case the primary use of Neo4j is for the RTree index. > However, I personally think it would be nicer (better) to store the > world-map as a single connected graph, so that countries that share boarders > actually share the nodes along those boarders. Yes, I prefer a connected graph, too. So something like country1.isNeighboursOf(country2) or getNeighbours(country) would be easy. > Our OSMImporter for Open > Street Map maintains the OSM graph in Neo4j, as well as exposes individual > geometries for those tools that require them (eg. renderers). You could do a > similar thing if you had a data source that contained that topology. Normal > GeoJSON, however, does not, since it describes each feature or geometry as a > separate object, with no spatial relationship to any other object. Is > GeoJSON the main data source, or can you get a more topologically connected > data source from polymaps? The GeoJSON files are generated with the OGR Layer Converter, and the original data is a shapefile from http://thematicmapping.org/downloads/world_borders.php (TM_WORLD_BORDERS-0.3.zip <http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip>). Does this file contain topologically connected structures? > So, to summarize the options: > > - Write a plain GeoJSON importer that imports to individual WKB > geometries - very simple, could even base on a raw JSON library and write > a > small mapping layer for your Geometries using JTS, or you could use a > GeoJSON library like the GeoTools one already suggested > - Write your own new data model, maintaining connectivity to your other > data (if that exists) and a 'better' world map graph. > - If you do not have access to a fully connected world map of countries, > perhaps using OSM data for this is an alternative to your current data > source. These all are good suggestions that I will consider. Maybe it's another option to use the original shapefile for import and just build a GeoJSON exporter. I hope I'll figure it out this week .. Axel _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

