bjornharrtell / jts2geojson

JTS from/to GeoJSON converter for Java
MIT License
141 stars 57 forks source link

GeoJSONFactory cannot parse features with null geometries #20

Closed amanbhurji closed 7 years ago

amanbhurji commented 7 years ago

RFC7946 3.2 reads

A Feature object has a member with the name "geometry".  The value
of the geometry member SHALL be either a Geometry object as
defined above or, in the case that the Feature is unlocated, a
JSON null value.

Parsing a Geojson with null geometry throws a NullPointerException which should be processed per the RFC. """{"type":"Feature","geometry":null,"properties":{"test":1}}"""

Steps to reproduce current behaviour:

val json = """{"type":"Feature","geometry":null,"properties":{"test":1}}"""
GeoJSONFactory.create(json)