top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

what is the Geojson and uses?

0 votes
362 views

What is Geojson?

GeoJSON is 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:

1)Point
2)LineString
3) Polygon
4) MultiPoint
5) MultiLineString
6) MultiPolygon
7)GeometryCollection.

Example code structure for Geojson:

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [125.6, 10.1]
  },
  "properties": {
    "name": "Dinagat Islands"
  }
}

The main use for Geojson is used to creating a maps.

GeoJSON is supported by numerous mapping and GIS software packages, including OpenLayers, Leaflet, MapServer,Geoforge software, GeoServer, GeoDjango, GDAL, Safe Software FME, and CartoDB.

It is also possible to use GeoJSON with PostGIS and Mapnik, both of which handle the format via the GDAL OGR conversion library. Bing Maps, Yahoo! and Google also support GeoJSON in their API services.

The Google Maps Javascript API v3 directly supports the integration of GeoJSON data layers as of March 19, 2014.

GitHub also supports GeoJSON rendering and Potrace GeoJSON export.

Videos for Using Geojson

posted Jan 19, 2015 by Pardeep Kohli

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button


Related Articles

D3.js is a JavaScript library for manipulating documents based on data.

Using D3 we can create a map.D3 provides API for creating a map.

It provides may ways creating methods.

Some of the methods

  • d3.geoAiry()
  • d3.geoAlbers()
  • d3.geoArmadillo() 
  • d3.geoAugust()
  • d3.geoAzimuthalEqualArea()
  • d3.geoAzimuthalEquidistant()
  • d3.geoBerghaus() 
  • d3.geoBoggs()
  • d3.geoBottomley() 
  • d3.geoChamberlinAfrica() 
  • d3.geoConicConformal() 
  • d3.geoConicEquidistant()
  • d3.geoCraster()
  • d3.geoCylindricalEqualArea()
  • d3.geoCylindricalStereographic()​

Example Code for Creatiing Map in D3 Using countries.geo.json

 

HTML CODE

<svg id="map">
</svg>​

Javascript Code 

    var width = 1200;
    var height = 800;

    var elm = d3.select('#map')
                .attr('width',width+'px')
                .attr('height',height+'px');


    var projection = d3.geoAzimuthalEqualArea().scale(130);

    var path = d3.geoPath().projection(projection);

    var graticule = d3.geoGraticule();

    elm.append("path")
    .datum(graticule)
    .attr("class", "graticule")
    .attr("d", path);


    d3.json("./assets/json/countries.geo.json", function (data) {
        elm.selectAll('path')
            .data(data.features)
            .enter()
            .append('path')
            .attr('d',path)
            .attr('fill','blue');

        elm.selectAll('circle')
            .data(data.features)
            .enter()
            .append('circle')
            .attr('r',Math.random()*10)
            .attr("transform", function(d) {
                var p = projection(d3.geoCentroid(d));
                return "translate("+p+")";
            });

        });

  }]);

Output Screen for above code:


Video Tutorial for MAP Creation

https://www.youtube.com/watch?v=lJgEx_yb4u0​

 

READ MORE
...