POSTGIS_DEBUGF(3, "parse_geojson_point called with root_srid = %d.", *root_srid );
coords = findMemberByName( geojson, "coordinates" );
-
+ if ( ! coords )
+ geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
+
pa = ptarray_construct_empty(1, 0, 1);
parse_geojson_coord(coords, hasz, pa);
POSTGIS_DEBUG(2, "parse_geojson_linestring called.");
points = findMemberByName( geojson, "coordinates" );
+ if ( ! points )
+ geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
pa = ptarray_construct_empty(1, 0, 1);
int ring = 0;
rings = findMemberByName( geojson, "coordinates" );
+ if ( ! rings )
+ geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
ppa = (POINTARRAY**) lwalloc(sizeof(POINTARRAY*));
}
poObjPoints = findMemberByName( geojson, "coordinates" );
+ if ( ! poObjPoints )
+ geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
if( json_type_array == json_object_get_type( poObjPoints ) )
{
}
poObjLines = findMemberByName( geojson, "coordinates" );
+ if ( ! poObjLines )
+ geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
if( json_type_array == json_object_get_type( poObjLines ) )
{
}
poObjPolys = findMemberByName( geojson, "coordinates" );
+ if ( ! poObjPolys )
+ geojson_lwerror("Unable to find 'coordinates' in GeoJSON string", 4);
if( json_type_array == json_object_get_type( poObjPolys ) )
{
}
poObjGeoms = findMemberByName( geojson, "geometries" );
+ if ( ! poObjGeoms )
+ geojson_lwerror("Unable to find 'geometries' in GeoJSON string", 4);
if( json_type_array == json_object_get_type( poObjGeoms ) )
{
SELECT '#1305.2',abs(ST_Distance(e, ST_Project(s, ST_Distance(s, e), ST_Azimuth(s, e)))) < 0.001 FROM pts;
SELECT '#1305.3',ST_Azimuth('POINT(0 45)'::geography, 'POINT(0 45)'::geography) IS NULL;
+-- #1434
+select '#1434: Next two errors';
+select '#1434.1',ST_GeomFromGeoJSON('{ "type": "Point", "crashme": [100.0, 0.0] }');
+select '#1434.2',ST_GeomFromGeoJSON('crashme');;
+
+
-- Clean up
DELETE FROM spatial_ref_sys;