SlideShare une entreprise Scribd logo
1  sur  29
No(Geo)SQL
  Geographic search in (No)SQL
8 years mappy.com as platform architect
     and deputy CTO



     Founding partner of NovaCodex since 2008

     @NHelleringer




Me
Geo in databases
      What the point ?




Why
Geo in databases challenges

       Data is complex to store in SQL

       Data is bi dimensional

       Data is dense

       Data is huge




Why
Multiples dimensions but B-trees sort on one
      Query dependent index sorting calculation




      New data structures and algorithms to handle dimensions
      A two phases search : select and then filter




Origin (challenge)
Geographic Information Systems
                                handling of geometric objects

     The origins of geography in the information systems are in the needs
     administrations had to handle data of the real world :
           Geology / Geography
           Roads, administrative areas for cadastral surveys
           Census data
           Infrastructure elements (water delivery network, electrical delivery
            network, communication network)

     Other needs came when the data became available and use the same
     tools :
         Geo marketing (market areas)




Origin (needs)
All you ever hated about SQL … and more !

       Complex SQL additions

       Full size complex normalized API

       Vendor dependent implementations

       Not scalable




How
The Open Geospatial Consortium edits a norm : OpenGIS
                  Oracle
                                                         SQL Server
           Quad Trees / R-Trees
                                                      4 level Grid Index
         Oracle 4 side dev (1984)
                                                  Since 2008 version (2007)
       integrated in Oracle 7 (1992)
                                                         PostgreSQL
                 Spatialite
                                                       R-tree-over-GiST
                  R-Trees
                                                   since PostGIS 1.0 for 8.0
           since 3.6.0 (Mar 2008)
                                                          (Apr 2005)

    MySQL since Feb 2005, DB2 Spatial Extender since July 2006, Ingres added
    support very recently

    Hibernate Spatial is a generic access to OpenGis implementations

    GIS Software as ESRI, MapInfo, GeoConcept, QuantumGIS use this standard to
    access data




Current Implementations (traditionnal SGBD)
Do we need all this ?

            Is Geo only for geo
            centric companies ?



Puzzled ?
LBS changed everything !

       Maps, geocoding & route planning available

       Platforms handle millions of hits/day

       Available through multiples APIs

       Often for free




How
MAPS                          GEOCODING

  Data is huge and complex           Data is huge
  objects
  Indexing is geo
                                     Not a geo problem
  Processing capabilities required   Expertise extremely valued

             Provided                           Provided
        ROUTE PLANNING                        POI SEARCH

  Data is huge                       Data is less huge (your
  Not a geo problem                  business size)
  Not shard able                     Indexing is geo
                                     May shard
             Provided                          Less relevant

How
Location aware data
                handling of data associated with a latitude/longitude tuple


     Location became a search criterion :
         Geo search
          The map/the geography is the center of the search process
         Proximity search
           The location is one in many criteria to refine a search




Origin (needs)
Does NoSQL
      help ?


New Solutions ?
Why does Geo fits a NoSQL approach ?

   Geo does not fit in traditional ‘pure’ DBMS : First normal form
   (1NF), many dimensions in one column break the rules
                        (48,23) <?> (47,25)

   Geo Objects hard to be strictly defined by SQL types : they are
   fickle


   Tim Anglade ‘No SQL for fun and profit’ : Geo/hierarchical is
   one of seven forms of NoSQL to date




Geo as a NoSQL Technology
Extensions to SQL or NoSQL data stores
      Quad-trees
      R-trees




Geo as a NoSQL Technology
quad-tree
Search steps
     1) Select
           Compute level
           Compute boxes ids
           Fetch boxes

     2) Filter
           Compute distance
           Select result set


   Limits
      High levels




How does it work ?
r-tree
Spatial Lucene/Solr, Elastic Search
       Quad tree labels in Lucene tokens
       Tile indices or GeoHash labels




    GeoCouch
       R-tree in Erlang


    Neo4J Spatial
       R-tree & quad-tree
       Object can be stored as graph elements




Current Implementations (NoSQL databases)
MongoDb
       Geo hashes into MongoDB B-trees
       Shard support incoming
       Spherical model since 1.7




    Pincaster
       In memory quad tree




Current Implementations (NoSQL databases)
How do I build PoI search ?




How
Do it in pure SQL !!

   Use a clustered long, lat index :
     o Select is done by the cluster on longitude
        (whish is more selective than latitude !)
     o Bounding box requests are handled on the
        index level as latitude is included
     o Filter with distance calculation can be
        done by a stored procedure on the
        database side or in application code




POI Search
Lucene via Hibernate Search

     o   Available in 4.2 beta 1
     o   Annotation based
     o   Simple to step in
     o   Refine by usage
     o   DSL supported




POI Search
@Indexed
   @Spatial
   public class Hotel {
      @Latitude
      Double latitude;
      @Longitude
      Double longitude;
      [...]




Sample indexation code
QueryBuilder builder =
   fullTextSession.getSearchFactory()
      .buildQueryBuilder().forEntity( PoI.class ).get();

   double centerLatitude= 24;
   double centerLongitude= 31.5;

   Query luceneQuery = builder.spatial()
      .onCoordinates( PoI.class.getName() )
      .within( 50, Unit.KM )
      .ofLatitude( centerLatitude )
      .andLongitude( centerLongitude )
      .createQuery();




Sample search code
Thank you for listening !




End !
http://www.slideshare.net/timanglade/nosql-for-fun-profit
      http://en.wikipedia.org/wiki/First_normal_form
      http://en.wikipedia.org/wiki/Quadtree
      http://technet.microsoft.com/en-us/library/bb964712.aspx
      http://www.nsshutdown.com/projects/lucene/whitepaper/locallucene_v2.html
      http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-geospatial-queries-with-
      couchdb:2008-10-26:en,CouchDB,Python,geo
      http://wiki.neo4j.org/content/Neo4j_Spatial
      http://www.osgeo.org/
      http://relation.to/Bloggers/SpatialQueriesFirstBetaForHibernateSearch42IsAv
      ailable

      http://www.novacodex.net/




Ref

Contenu connexe

Tendances

Neo4j - Graph Database
Neo4j - Graph DatabaseNeo4j - Graph Database
Neo4j - Graph Database
Mubashar Iqbal
 
Nosql databases for the .net developer
Nosql databases for the .net developerNosql databases for the .net developer
Nosql databases for the .net developer
Jesus Rodriguez
 
Hypercubes In Hbase
Hypercubes In HbaseHypercubes In Hbase
Hypercubes In Hbase
George Ang
 
Redis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - OmnilogicRedis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - Omnilogic
Felipe Guimarães
 

Tendances (20)

HBaseCon2017 Apache HBase at Didi
HBaseCon2017 Apache HBase at DidiHBaseCon2017 Apache HBase at Didi
HBaseCon2017 Apache HBase at Didi
 
Neo4j - Graph Database
Neo4j - Graph DatabaseNeo4j - Graph Database
Neo4j - Graph Database
 
Why geoserver
Why geoserverWhy geoserver
Why geoserver
 
Nosql databases for the .net developer
Nosql databases for the .net developerNosql databases for the .net developer
Nosql databases for the .net developer
 
Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
 
Mongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersMongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP Developers
 
Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010Introduction to Hadoop - ACCU2010
Introduction to Hadoop - ACCU2010
 
MongoDB
MongoDBMongoDB
MongoDB
 
Windows Azure Caching
Windows Azure CachingWindows Azure Caching
Windows Azure Caching
 
Visualise Your Cloud Data Strategy: MongoDB Atlas and Charts (Sponsored by Mo...
Visualise Your Cloud Data Strategy: MongoDB Atlas and Charts (Sponsored by Mo...Visualise Your Cloud Data Strategy: MongoDB Atlas and Charts (Sponsored by Mo...
Visualise Your Cloud Data Strategy: MongoDB Atlas and Charts (Sponsored by Mo...
 
Rich storytelling with Drupal, Paragraphs and Islandora DAMS
Rich storytelling with Drupal, Paragraphs and Islandora DAMSRich storytelling with Drupal, Paragraphs and Islandora DAMS
Rich storytelling with Drupal, Paragraphs and Islandora DAMS
 
Hadoop hbase introduction
Hadoop hbase introductionHadoop hbase introduction
Hadoop hbase introduction
 
Cloud Computing and the Microsoft Developer - A Down-to-Earth Analysis
Cloud Computing and the Microsoft Developer - A Down-to-Earth AnalysisCloud Computing and the Microsoft Developer - A Down-to-Earth Analysis
Cloud Computing and the Microsoft Developer - A Down-to-Earth Analysis
 
Share point 2013 on azure
Share point 2013 on azureShare point 2013 on azure
Share point 2013 on azure
 
Integrating HDF5 with SRB
Integrating HDF5 with SRBIntegrating HDF5 with SRB
Integrating HDF5 with SRB
 
CouchDB
CouchDBCouchDB
CouchDB
 
Hypercubes In Hbase
Hypercubes In HbaseHypercubes In Hbase
Hypercubes In Hbase
 
Redis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - OmnilogicRedis e Memcached - Daniel Naves - Omnilogic
Redis e Memcached - Daniel Naves - Omnilogic
 
george.farquhar.resume2
george.farquhar.resume2george.farquhar.resume2
george.farquhar.resume2
 
Apache Gobblin at MZ
Apache Gobblin at MZApache Gobblin at MZ
Apache Gobblin at MZ
 

En vedette

7-Waterlogging and salinity
7-Waterlogging and salinity7-Waterlogging and salinity
7-Waterlogging and salinity
samra marrium
 

En vedette (14)

Water Temperature Data Logging Webinar
Water Temperature Data Logging WebinarWater Temperature Data Logging Webinar
Water Temperature Data Logging Webinar
 
المدونات (Web log)
المدونات (Web log)المدونات (Web log)
المدونات (Web log)
 
Log Management and Analysis for Cloud Applications
Log Management and Analysis for Cloud ApplicationsLog Management and Analysis for Cloud Applications
Log Management and Analysis for Cloud Applications
 
SolarWinds Log & Event Manager vs Splunk. What's the Difference?
SolarWinds Log & Event Manager vs Splunk. What's the Difference?SolarWinds Log & Event Manager vs Splunk. What's the Difference?
SolarWinds Log & Event Manager vs Splunk. What's the Difference?
 
Illegal logging
Illegal loggingIllegal logging
Illegal logging
 
ILLEGAL LOGGING
ILLEGAL LOGGINGILLEGAL LOGGING
ILLEGAL LOGGING
 
Water logging
Water loggingWater logging
Water logging
 
Water logging - An ill-effect of Irrigation
Water logging - An ill-effect of Irrigation Water logging - An ill-effect of Irrigation
Water logging - An ill-effect of Irrigation
 
Water logging and salinity control
Water logging and salinity controlWater logging and salinity control
Water logging and salinity control
 
7-Waterlogging and salinity
7-Waterlogging and salinity7-Waterlogging and salinity
7-Waterlogging and salinity
 
Salanity
SalanitySalanity
Salanity
 
Water logging salinity
Water logging  salinityWater logging  salinity
Water logging salinity
 
water logging and salinity in pakistan by Musadiq Rehmani
water logging and salinity in pakistan by Musadiq Rehmaniwater logging and salinity in pakistan by Musadiq Rehmani
water logging and salinity in pakistan by Musadiq Rehmani
 
Formation evaluation and well log correlation
Formation evaluation and well log correlationFormation evaluation and well log correlation
Formation evaluation and well log correlation
 

Similaire à No(Geo)SQL

Mapping, GIS and geolocating data in Java
Mapping, GIS and geolocating data in JavaMapping, GIS and geolocating data in Java
Mapping, GIS and geolocating data in Java
Joachim Van der Auwera
 
The State of Big Data for Geo - ESRI Big Data Meetup
The State of Big Data for Geo - ESRI Big Data MeetupThe State of Big Data for Geo - ESRI Big Data Meetup
The State of Big Data for Geo - ESRI Big Data Meetup
seagor
 
Open source Geospatial Business Intelligence in action with GeoMondrian and S...
Open source Geospatial Business Intelligence in action with GeoMondrian and S...Open source Geospatial Business Intelligence in action with GeoMondrian and S...
Open source Geospatial Business Intelligence in action with GeoMondrian and S...
Thierry Badard
 

Similaire à No(Geo)SQL (20)

Graph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemGraph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft Ecosystem
 
Neo4j Spatial - Backing a GIS with a true graph database
Neo4j Spatial - Backing a GIS with a true graph databaseNeo4j Spatial - Backing a GIS with a true graph database
Neo4j Spatial - Backing a GIS with a true graph database
 
Mapping, GIS and geolocating data in Java
Mapping, GIS and geolocating data in JavaMapping, GIS and geolocating data in Java
Mapping, GIS and geolocating data in Java
 
The State of Big Data for Geo - ESRI Big Data Meetup
The State of Big Data for Geo - ESRI Big Data MeetupThe State of Big Data for Geo - ESRI Big Data Meetup
The State of Big Data for Geo - ESRI Big Data Meetup
 
Open Source Databases And Gis
Open Source Databases And GisOpen Source Databases And Gis
Open Source Databases And Gis
 
Au09 Presentation Ut118 1
Au09 Presentation Ut118 1Au09 Presentation Ut118 1
Au09 Presentation Ut118 1
 
Mapping, GIS and geolocating data in Java @ JAX London
Mapping, GIS and geolocating data in Java @ JAX LondonMapping, GIS and geolocating data in Java @ JAX London
Mapping, GIS and geolocating data in Java @ JAX London
 
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
Java Tech & Tools | Mapping, GIS and Geolocating Data in Java | Joachim Van d...
 
GeoKettle: A powerful open source spatial ETL tool
GeoKettle: A powerful open source spatial ETL toolGeoKettle: A powerful open source spatial ETL tool
GeoKettle: A powerful open source spatial ETL tool
 
Adelaide Ruby Meetup PostGIS Notes
Adelaide Ruby Meetup PostGIS NotesAdelaide Ruby Meetup PostGIS Notes
Adelaide Ruby Meetup PostGIS Notes
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech Projects
 
Gislec1
Gislec1Gislec1
Gislec1
 
Neo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in MalmöNeo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in Malmö
 
Geospatial Business Intelligence made easy with GeoMondrian & SOLAPLayers
Geospatial Business Intelligence made easy with GeoMondrian & SOLAPLayersGeospatial Business Intelligence made easy with GeoMondrian & SOLAPLayers
Geospatial Business Intelligence made easy with GeoMondrian & SOLAPLayers
 
Geoprocessing with Neo4j-Spatial and OSM
Geoprocessing with Neo4j-Spatial and OSMGeoprocessing with Neo4j-Spatial and OSM
Geoprocessing with Neo4j-Spatial and OSM
 
2016-01 Lucene Solr spatial in 2015, NYC Meetup
2016-01 Lucene Solr spatial in 2015, NYC Meetup2016-01 Lucene Solr spatial in 2015, NYC Meetup
2016-01 Lucene Solr spatial in 2015, NYC Meetup
 
Exploratory Spatial Analytics (ESA)
Exploratory Spatial Analytics (ESA)Exploratory Spatial Analytics (ESA)
Exploratory Spatial Analytics (ESA)
 
Ozri 2013 Brisbane, Australia - Geodatabase Efficiencies
Ozri 2013 Brisbane, Australia - Geodatabase EfficienciesOzri 2013 Brisbane, Australia - Geodatabase Efficiencies
Ozri 2013 Brisbane, Australia - Geodatabase Efficiencies
 
Spatially enabled open source BI (GeoBI) with GeoKettle, GeoMondrian & SOLAPL...
Spatially enabled open source BI (GeoBI) with GeoKettle, GeoMondrian & SOLAPL...Spatially enabled open source BI (GeoBI) with GeoKettle, GeoMondrian & SOLAPL...
Spatially enabled open source BI (GeoBI) with GeoKettle, GeoMondrian & SOLAPL...
 
Open source Geospatial Business Intelligence in action with GeoMondrian and S...
Open source Geospatial Business Intelligence in action with GeoMondrian and S...Open source Geospatial Business Intelligence in action with GeoMondrian and S...
Open source Geospatial Business Intelligence in action with GeoMondrian and S...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

No(Geo)SQL

  • 1. No(Geo)SQL Geographic search in (No)SQL
  • 2. 8 years mappy.com as platform architect and deputy CTO Founding partner of NovaCodex since 2008 @NHelleringer Me
  • 3. Geo in databases What the point ? Why
  • 4. Geo in databases challenges  Data is complex to store in SQL  Data is bi dimensional  Data is dense  Data is huge Why
  • 5. Multiples dimensions but B-trees sort on one Query dependent index sorting calculation New data structures and algorithms to handle dimensions A two phases search : select and then filter Origin (challenge)
  • 6. Geographic Information Systems handling of geometric objects The origins of geography in the information systems are in the needs administrations had to handle data of the real world :  Geology / Geography  Roads, administrative areas for cadastral surveys  Census data  Infrastructure elements (water delivery network, electrical delivery network, communication network) Other needs came when the data became available and use the same tools :  Geo marketing (market areas) Origin (needs)
  • 7. All you ever hated about SQL … and more !  Complex SQL additions  Full size complex normalized API  Vendor dependent implementations  Not scalable How
  • 8. The Open Geospatial Consortium edits a norm : OpenGIS Oracle SQL Server Quad Trees / R-Trees 4 level Grid Index Oracle 4 side dev (1984) Since 2008 version (2007) integrated in Oracle 7 (1992) PostgreSQL Spatialite R-tree-over-GiST R-Trees since PostGIS 1.0 for 8.0 since 3.6.0 (Mar 2008) (Apr 2005) MySQL since Feb 2005, DB2 Spatial Extender since July 2006, Ingres added support very recently Hibernate Spatial is a generic access to OpenGis implementations GIS Software as ESRI, MapInfo, GeoConcept, QuantumGIS use this standard to access data Current Implementations (traditionnal SGBD)
  • 9.
  • 10. Do we need all this ? Is Geo only for geo centric companies ? Puzzled ?
  • 11. LBS changed everything !  Maps, geocoding & route planning available  Platforms handle millions of hits/day  Available through multiples APIs  Often for free How
  • 12. MAPS GEOCODING Data is huge and complex Data is huge objects Indexing is geo Not a geo problem Processing capabilities required Expertise extremely valued Provided Provided ROUTE PLANNING POI SEARCH Data is huge Data is less huge (your Not a geo problem business size) Not shard able Indexing is geo May shard Provided Less relevant How
  • 13. Location aware data handling of data associated with a latitude/longitude tuple Location became a search criterion :  Geo search The map/the geography is the center of the search process  Proximity search The location is one in many criteria to refine a search Origin (needs)
  • 14.
  • 15. Does NoSQL help ? New Solutions ?
  • 16. Why does Geo fits a NoSQL approach ? Geo does not fit in traditional ‘pure’ DBMS : First normal form (1NF), many dimensions in one column break the rules (48,23) <?> (47,25) Geo Objects hard to be strictly defined by SQL types : they are fickle Tim Anglade ‘No SQL for fun and profit’ : Geo/hierarchical is one of seven forms of NoSQL to date Geo as a NoSQL Technology
  • 17. Extensions to SQL or NoSQL data stores  Quad-trees  R-trees Geo as a NoSQL Technology
  • 19. Search steps 1) Select  Compute level  Compute boxes ids  Fetch boxes 2) Filter  Compute distance  Select result set Limits  High levels How does it work ?
  • 21. Spatial Lucene/Solr, Elastic Search  Quad tree labels in Lucene tokens  Tile indices or GeoHash labels GeoCouch  R-tree in Erlang Neo4J Spatial  R-tree & quad-tree  Object can be stored as graph elements Current Implementations (NoSQL databases)
  • 22. MongoDb  Geo hashes into MongoDB B-trees  Shard support incoming  Spherical model since 1.7 Pincaster  In memory quad tree Current Implementations (NoSQL databases)
  • 23. How do I build PoI search ? How
  • 24. Do it in pure SQL !! Use a clustered long, lat index : o Select is done by the cluster on longitude (whish is more selective than latitude !) o Bounding box requests are handled on the index level as latitude is included o Filter with distance calculation can be done by a stored procedure on the database side or in application code POI Search
  • 25. Lucene via Hibernate Search o Available in 4.2 beta 1 o Annotation based o Simple to step in o Refine by usage o DSL supported POI Search
  • 26. @Indexed @Spatial public class Hotel { @Latitude Double latitude; @Longitude Double longitude; [...] Sample indexation code
  • 27. QueryBuilder builder = fullTextSession.getSearchFactory() .buildQueryBuilder().forEntity( PoI.class ).get(); double centerLatitude= 24; double centerLongitude= 31.5; Query luceneQuery = builder.spatial() .onCoordinates( PoI.class.getName() ) .within( 50, Unit.KM ) .ofLatitude( centerLatitude ) .andLongitude( centerLongitude ) .createQuery(); Sample search code
  • 28. Thank you for listening ! End !
  • 29. http://www.slideshare.net/timanglade/nosql-for-fun-profit http://en.wikipedia.org/wiki/First_normal_form http://en.wikipedia.org/wiki/Quadtree http://technet.microsoft.com/en-us/library/bb964712.aspx http://www.nsshutdown.com/projects/lucene/whitepaper/locallucene_v2.html http://vmx.cx/cgi-bin/blog/index.cgi/geocouch-geospatial-queries-with- couchdb:2008-10-26:en,CouchDB,Python,geo http://wiki.neo4j.org/content/Neo4j_Spatial http://www.osgeo.org/ http://relation.to/Bloggers/SpatialQueriesFirstBetaForHibernateSearch42IsAv ailable http://www.novacodex.net/ Ref

Notes de l'éditeur

  1. (1 table points, 1 table lines, 1 table polylines, …)
  2. (1 table points, 1 table lines, 1 table polylines, …)(no standard indexing)(range queries)(severalhundred of Gb for the whole world roads)
  3. , location centric calculations
  4. (new keywords, new request syntax)(more than 200 functions to implement)
  5. Location Based SystemMapQuest, Mappy, Google Maps