Global Positioning System Reference
In-Depth Information
fi rst two queries, the initial steps consist of the instantiation of the Search
type objects, which enable the application of constraints in the access to
data layers. The creation of the variables “gasStations” and “route66” was
suppressed because they are similar to the “hospital” variable, illustrated in
Fig. 17. The startContainSearch() method (line 11 of Fig. 18) obtains a list of all
PoIs contained in the geometry of the Route 66. Thus, to obtain only the gas
stations, it is necessary to fi lter this list by the “type” attribute of the “POIS”
entity. Finally, a count method is used to obtain the number of gas stations in
the fi ltered list.
An excerpt of the algorithm implemented to answer query Q4 (list the
roads that cross Chicago) in Neo4j Spatial is illustrated in Fig. 19. The main
difference from query Q3 is that we use the startCrossSearch() method, as
observed in the ninth line of Fig. 19. This method allows the retrieval of all
of the roads that cross the city of Chicago.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
Search searchQuery1 = new SearchCQL(
spatialService.getLayer("MUNICIPALITIES"),
"name = 'Chicago'");
...
// chicago is a var. of type List<SpatialDatabaseRecord>
...
GeoPipeline pipe = GeoPipeline. startCrossSearch (
spatialService.getLayer("HIGHWAYS"),
chicago.getGeometry());
List<SpatialDatabaseRecord> highwayCrosses =
pipe.toSpatialDatabaseRecordList();
...
Fig. 19. An excerpt of the algorithm to answer Q4 in Neo4j Spatial.
BigTable
The data was uploaded into BigTable through the python statement
“appcfg.py”, as illustrated in Fig. 20. This statement has some mandatory
attributes. For instance, the “application” attribute requires the id of the
user application registered for Google. The “fi lename” attribute requires
the path of the csv fi le and “<app-directory>” refers to the application
directory path in the Google App Engine. It is worth mentioning that the
fi le “ pois.csv” used the in example illustrated in Fig. 20 contains the same
information of “ pois.shp” . In other words, it is the same fi le but represented
in another format.
Due to the limitations of the GeoModel, which only supports the Point
data type and bounding-box queries, we will provide details only for the
queries Q1 and Q2. These queries make use of the functions proximity_fetch
(query, center, max_result=10, max_distance=0) and bounding_box_fetch
Search WWH ::




Custom Search