GeoCO GeoJSON & GeoLocate
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

GeoCO GeoJSON & GeoLocate

on

  • 1,286 views

Presentation given at Geo-CO meetup in Denver.

Presentation given at Geo-CO meetup in Denver.

Statistics

Views

Total Views
1,286
Views on SlideShare
1,286
Embed Views
0

Actions

Likes
1
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

GeoCO GeoJSON & GeoLocate Presentation Transcript

  • 1. GEO ColoradoGeoJSON & GeoLocate
  • 2. Key Points• Introduce GeoJSON• Talk about GeoJSON Libs and Examples• Introduce GeoLocate• Talk about GeoLocate Libs and Examples
  • 3. GeoJSON • A format for encoding a variety of geographic data structures. • A GeoJSON object may represent a geometry, a feature, or a collection of features. • GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. • Features in GeoJSON contain a geometry object and additional properties, and a feature collection represents a list of features.http://www.geojson.org/
  • 4. PostGIS • Since version 1.3.4 Getting Data Out • SELECT ST_AsGeoJSON(the_geom) FROM table Putting Data In • INSERT INTO table (the_geom) VALUES ( ST_SetSRID( ST_GeomFromGeoJSON({"type":"Point","coordinates":[-104.983718,39.760808]}) ,4326 ) )http://postgis.refractions.net/documentation/manual-2.0/ST_GeomFromGeoJSON.htmlhttp://postgis.refractions.net/documentation/manual-2.0/ST_AsGeoJSON.html
  • 5. PostGIS PostgresSQL 9.2 – New JSON Datatype • http://wiki.postgresql.org/wiki/What%27s_new_in_PostgreSQL_9.2#JSON_datatype FeatureCollection • SELECT row_to_json(fc) FROM ( SELECT FeatureCollection As type, array_to_json(array_agg(f)) As features FROM (SELECT Feature As type , ST_AsGeoJSON(lg.the_geom)::json As geometry , row_to_json((SELECT l FROM (SELECT id, name) As l )) As properties FROM locations As lg ) As f ) As fc; Currently CartoDB is on version PostgreSQL 9.1.2 but they do support GeoJSON output format. See http://developers.cartodb.com/documentation/cartodb-apis.htmlhttp://www.postgresonline.com/journal/archives/267-Creating-GeoJSON-Feature-Collections-with-JSON-and-PostGIS-functions.html
  • 6. Using GeoJSON with Google Maps• Example: http://jsfiddle.net/x3pCk/8/• Library: https://github.com/JasonSanford/GeoJSON-to-Google-Maps
  • 7. Using GeoJSON with Leaflet• http://leaflet.cloudmade.com/examples/geojson.html• http://leaflet.cloudmade.com/reference.html#geojson
  • 8. Using GeoJSON with OpenLayers• http://docs.openlayers.org/library/spherical_mercator.html• http://openlayers.org/dev/examples/vector-formats.htmlvar geojson = new OpenLayers.Layer.GML("GeoJSON", "geo.json", { projection: new OpenLayers.Projection("EPSG:4326") , format: OpenLayers.Format.GeoJSON});map.addLayer(geojson);
  • 9. In February of 2002, Dr. Bart and Nelson Rios received funding from the U.S. NationalScience foundation to develop GeoLocate to facilitate georeferencing of naturalhistory collections data, a tool for comprehensive automated georeferencing of NorthAmerican locality descriptions. Ongoing development involves expanding coverage to theentire world, multi-lingual support, user-defined pattern recognition, and collaborativegeoreferencing.• Developed by Tulane University• Uses gazetteers, streams, rivers, roads, landmarks, geonames data set• Open Street Maps data coming in the near future• Uses GeoJSON for its RESTful responses• API: http://www.museum.tulane.edu/webservices/geolocatesvcv2/glcwrap.aspx• Ref: http://www.museum.tulane.edu/webservices/geolocatesvc/geolocatesvc.asmxhttp://www.museum.tulane.edu/geolocate/
  • 10. Example Strings Good vs Bad • http://mvz.berkeley.edu/Locality_Field_Recording_examples.htmlState County LocalityAlabama Russell Adams Branch, 3.0 road miles WSW junction County Highway 32 and Rt. 80 on 32, 4.75 air miles WSW Crawford, (T17N, R28E, Sec. 32)Louisiana East Feliciana Amite R. at LA 10 crossing, 4 mi. W of Darlington on LA Hwy 10Alabama Lee Uchee Cr., trib.of Chattahoochee R., 0.7 mi. E of MarvynAlabama Russell Trib. of Uchee Cr., 3.1 mi. E of MarvynAlabama Russell Trib. of Little Uchee Cr., 0.9 mi. E of Crawford on Rt.80 • Guide to Best Practices for Georeferencing http://www.gbif.org/orc/?doc_id=1288
  • 11. Sample RequestRequest• http://www.museum.tulane.edu/webservices/geolocatesvcv2/glcwrap.aspx?locality=E shore of Bolinas Lagoon, 3.1 mi NW via Hwy. 1 from intersection of Hwy. 1 and Calle del Arroyo in Stinson Beach (town), Marin Co., Calif.&country=USA&state=CA&county=marin&language=0&enableH2O=true&enableHwy=true&r estrictToLowestAdm=false&enableUncert=true&doPoly=true&displacePoly=false&fmt=geojson o locality=E shore of Bolinas Lagoon, 3.1 mi NW via Hwy. 1 from intersection of Hwy. 1 and Calle del Arroyo in Stinson Beach (town), Marin Co., Calif. o country=USA o state=CA o county=marin o language=0 o enableH2O=true o enableHwy=true o restrictToLowestAdm=false o enableUncert=true o doPoly=true o displacePoly=false o fmt=geojson
  • 12. GeoJSON Libs for Google & LeafletProject Repository• http://code.google.com/p/geolocate-libs/• Google Map Example: http://www.silverbiology.com/clients/geolocate/geolocate-gmapsv3/example.html• Leaflet Example: http://www.silverbiology.com/clients/geolocate/geolocate-leaflet/example.html