Code Monkey home page Code Monkey logo

geojsonlint.com's People

Contributors

geographist avatar glenrobertson avatar jasonsanford avatar jidanni avatar michael-k avatar stonetip avatar tyrasd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geojsonlint.com's Issues

Enforcement of Polygon Right-Hand Rule

Hi Jason,
geojsonlint is a great tool for verifying geojson file geometry and displaying associated attributes. I've used it during the past year.
When I tested a new geojson file (and retested an older file that I used before), I noticed that you now enforce the polygon right-hand rule proposed in rfc7946.
https://tools.ietf.org/html/rfc7946#section-3.1.6
"A linear ring MUST follow the right-hand rule with respect to the
area it bounds, i.e., exterior rings are counterclockwise, and
holes are clockwise."
Unfortunately, enforcing this rule breaks the tool for all the key providers of GeoJSON files that I am working with. I'm writing to request you consider removing the constraint, or generalizing the code to support backward compatibility.
The specification notes the need for backward compatibility in this Note:
"Note: the [GJ2008] specification did not discuss linear ring winding
order. For backwards compatibility, parsers SHOULD NOT reject
Polygons that do not follow the right-hand rule."

Thanks for your consideration.
Rodd Halstead

Validate Arrays of objects

Hi developers,

not sure whether this is a bug or a missing feature. GeoJSONLint seems to be unable to validate arrays of GeoJSON objects. I just pasted the following example in the WebApp (http://geojsonlint.com/):

[
    {
        "type": "Point",
        "coordinates": [
            -105.01621,
            39.57422
        ]
    },
    {
        "type": "Point",
        "coordinates": [
            -105.01621,
            39.57422
        ]
    }
]

While jsonlint.com says it is valid; geojsonlint does not validate it, since it misses a JSON object. I re-read the spec and I found only this hint:

"GeoJSON always consists of a single object."

However, there was no hint that it was illegal to put multiple GeoJSON objects into one json file, so I believe the example is valid.

For the record: In general it is okay for me to use jsonlint for structure checking and geojsonlint to do the geojson part, but it is of course more convenient to use only one tool for checking a geojson file.

Cheers,
Matthias

Doesn't handle when geometry is invalid

I'm trying to validate some GeoJSON and I just happen to be using:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "Fulcrum Id": null,
        "Created At": null,
        "Updated At": null,
        "Created By": null,
        "Updated By": null,
        "System Created At": null,
        "System Updated At": null,
        "Version": null,
        "Status": null,
        "Project": null,
        "Assigned To": null,
        "Latitude": null,
        "Longitude": null,
        "Geometry": null,
        "Park Name": "Philippe Park",
        "Operator": "Pinellas County",
        "Type of Facility": "Park / Recreation Area",
        "Type of Facility Other": null,
        "Address Sub thoroughfare": "2525",
        "Address Thoroughfare": "Philippe Parkway",
        "Address Locality": "Safety Harbor",
        "Address Sub admin area": "Pinellas",
        "Address Admin area": "FL",
        "Address Postal code": "34695",
        "Address Country": "US",
        "Address Suite": "2525",
        "Address Full": "2525 Philippe Parkway Safety Harbor Pinellas FL 34695 US 2525",
        "Operating Hours": "",
        "Photos": "b7ba82c5-7e22-4b00-8e6e-607960bf7369,665d643e-27a3-4133-8f6c-ec4fff2b0b3c",
        "Photos Captions": ",",
        "Gps Altitude": null,
        "Gps Horizontal Accuracy": null,
        "Gps Vertical Accuracy": null,
        "Gps Speed": null,
        "Gps Course": null
      },
      "geometry": null
    }
  ]
}

This isn't valid, but the site doesn't tell me this.

I see this in the console:
screen shot 2014-03-19 at 4 11 28 pm

Shouldn't it tell me when the geometry is not the right format?

The map assumes that GeoJSON cordinates are in wgs84, even when crs is given

The GeoJSON specs mention how the coordinate system can be specified in section 3 of the specs.

The map on the page assumes that the given coordinates are in Lat Long (which is the default, according to the specs) even when the coordinate system is given.

For example, a marker over New York can be given as:

{
    "type": "Point",
    "coordinates": [
       -8238354.76344332,
       4970277.18766739
    ],
    "crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::3857"}}
}

Now the problem is that the map tries to zoom into this location, assuming that the coordinates are in EPSG4326

I would suggest the following:
*If the crs is specified, then the map should try to project the geometry before displaying.
*If projection is not possible then a warning should be given
*If the coordinates do not fit within the expected range, a warning should be displayed.

Invalid Polygons

Correct me if I'm wrong, but, according to the GeoJSON specification,

For type "Polygon", the "coordinates" member must be an array of LinearRing coordinate arrays.

where

A LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points).

However, the example below parses as valid GeoJSON on geojsonlint.com (even though the first and last positions are NOT equivalent):

{
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          22.5,
          31.952162238025
        ],
        [
          33.75,
          31.952162238025
        ],
        [
          33.75,
          40.97989806962
        ],
        [
          22.5,
          40.97989806962
        ]
      ]
    ]
  },
  "properties": {
    "name": "Region: 12210 ",
    "featureType": "Regional aggregation of items for geo-spatial search",
    "href": "http://opencontext.org/sets/?geotile=12210",
    "hrefGeoJSON": "http://opencontext.org/sets/.geojson?geotile=12210",
    "count": 243137
  }
}

I realize Leaflet has no problem rendering this, but it also supports other features (such as nested FeatureCollections) that do not conform to GeoJSON v1.

SchemaError: Properties definition of field 'coordinates' is not a list or an object

View details in Rollbar: https://rollbar.com/item/138335057/

Traceback (most recent call last):
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/django/views/decorators/http.py", line 41, in inner
    return func(request, *args, **kwargs)
  File "/Users/jasonsanford/code/geojsonlint.com/geojsonlint/views.py", line 55, in validate
    validictory.validate(test_geojson, geojson_types[test_geojson['type']])
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/__init__.py", line 28, in validate
    return v.validate(data, schema)
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 531, in validate
    self._validate(data, schema)
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 534, in _validate
    self.__validate("_data", {"_data": data}, schema)
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 563, in __validate
    newschema.get(schemaprop))
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 191, in validate_properties
    properties.get(eachProp))
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 563, in __validate
    newschema.get(schemaprop))
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 153, in validate_type
    self.validate_type(x, fieldname, eachtype, eachtype)
  File "/Users/jasonsanford/code/geojsonlint.com/venv/lib/python2.7/site-packages/validictory/validator.py", line 166, in validate_type
    raise e
SchemaError: Properties definition of field 'coordinates' is not a list or an object

Feature request: Inserting envelope into displayed GeoJSON

Hi, I'd like to be able to drag an envelope over the displayed data, and to see its vertices when doing so. The reason is that I'm using GeoJSONLint for debugging test cases for geospatial queries and would like to use this to determine the search window that should give me the desired test data if my queries are working.

Typo in error message

When entering a GeoJSON sample missing the "type" property the error message is:

The "type" member is requried and was not found.

Should be:

The "type" member is required and was not found.

geojsonlinttype

Use celery for event tracking, maybe.

The ga-events branch is currently being served at heroku. This means Google Analytics events are being sent to GA inline with each validate request.

This is a little risky, so we should probably ship these off to celery so the request can continue to process without depending on a response from Google Analytics.

Validation: properties can be null, not just objects?

Thanks so much for hosting geojsonlint.com; it's really helpful.

I ran into a small nitpicky validation issue. The validator demands that in a Feature, properties is an object. But if I read the GeoJSON spec correctly properties can also be "null". I believe the GeoJSON below is valid but geojsonlint.com complains unless I switch the "null" to the empty object {}.

{
  "features": [
    {
      "properties": null,
      "id": "00210",
      "type": "Feature",
      "geometry": {
        "coordinates": [
          -71.013202,
          43.005895
        ],
        "type": "Point"
      }
    },
    {
      "properties": null,
      "id": "00211",
      "type": "Feature",
      "geometry": {
        "coordinates": [
          -71.013202,
          43.005895
        ],
        "type": "Point"
      }
    }
  ],
  "type": "FeatureCollection"
}

doesn't handle position "extensions" per spec

i am experimenting with extending positions with additional data. per spec that's allowed:

A position is represented by an array of numbers. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). Any number of additional elements are allowed -- interpretation and meaning of additional elements is beyond the scope of this specification.

however, this position causes GeoJSONLint to bail:

        [
          -122.45698875747621,
          37.78691156767309,
          138.1999969482422, 
          0, 
          0, 
          0
        ], 

is there any chance to fix the code to properly handle this and just ignore the additional elements?
also, i see different errors for the example above (zero values), and putting in NULL values. my reading of the spec is that NULL values are allowed as well, but i am not really sure about this.
geojson/draft-geojson#57 is an issue i have raised on the spec to clarify this point (number vs. non-number values), but i am pretty sure that number values must be accepted.

https://geojsonlint.com/ - OpenStreetMap data is used for map but attribution is missing

Hello,

As an OpenStreetMap contributor, I am pleased to see that you are using OpenStreetMap on your website.

However, I noticed that the map seems to lack the proper credit. OpenStreetMap's license requires that you both credit OpenStreetMap and make users aware of the data license. For more information, see: https://www.openstreetmap.org/copyright

Mapbox is hosting data and probably made this specific map style, including their logo is OK (and may be required by their ToC) but it is not attributing OpenStreetMap at all and is not fulfilling requirement to attribute source of data.

Initial view on loading the website:

screen01

Missing Type

There is no type property on the features in the example below, yet geojsonlint.com does not complain; however, Leaflet will not render it.

{
  "type": "FeatureCollection",
  "properties": {
    "title": "Displacements",
    "author": "MapAnalystOnline",
    "whatever": "date of creation? unique id generated from points?"
  },
  "features": [
    {
      "id": "1",
      "properties": {
        "displacement": 2.3,
        "color": "black"
      },
      "geometry": {
        "type": "GeometryCollection",
        "geometries": [
          {
            "type": "Point",
            "coordinates": [
              200,
              400
            ]
          },
          {
            "type": "LineString",
            "coordinates": [
              [
                200,
                400
              ],
              [
                230,
                440
              ]
            ]
          }
        ]
      }
    },
    {
      "id": "2",
      "properties": {
        "displacement": 3.7,
        "color": "red"
      },
      "geometry": {
        "type": "GeometryCollection",
        "geometries": [
          {
            "type": "Point",
            "coordinates": [
              1442,
              888
            ]
          },
          {
            "type": "LineString",
            "coordinates": [
              [
                1442,
                888
              ],
              [
                1450,
                825
              ]
            ]
          }
        ]
      }
    }
  ]
}

Don't run django in debug mode

There's no database connectivity or anything secret for this app, but we still shouldn't show raw error messages. This will require pushing/serving static files from S3. Will need django-storages and boto.

Validation: not checking geometry type?

I believe the following GeoJSON is broken, but the validator on geojsonlint.com isn't throwing an error. Specifically I've set the type of Geometry to a nonsense string.

{
  "features": [
    {
      "geometry": {
        "type": "BROKEN"
      },
      "properties": {},
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.