Bug report #19735

geoJSON layer displays point shapes but not polygons

Added by peter larson over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/OGR
Affected QGIS version:3.2.2 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:27560

Description

I have tried to add a geoJSON layer to a project using the following URL:

http://www.rfs.nsw.gov.au/feeds/majorIncidents.json

It contains two layers, the points layer displays, but the polygon layer does not display. I have tried a current project and a new (empty) project with the same result. Have also tried QGIS 2.18 and 3.2.2 with the same result. Looking at the JSON script, it does have both points and polygon data.

Not sure if it is the JSON, or a problem with the geoJSON handler.

majorIncidents-1.json - Sample JSON download (76 KB) peter larson, 2018-08-31 03:11 AM

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback
  • Operating System deleted (windows 7)
  • Category changed from Unknown to Data Provider/OGR

Very likely because OGR does not recognize the content as being polygons, is that a valid geojeon?

giovanni@sibirica:~/Downloads$ ogrinfo -so majorIncidents.json majorIncidents
INFO: Open of `majorIncidents.json'
using driver `GeoJSON' successful.

Layer name: majorIncidents
Geometry: Unknown (any)
Feature Count: 31
Extent: (146.578418, -36.849013) - (153.207028, -28.434733)
Layer SRS WKT:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
title: String (0.0)
link: String (0.0)
category: String (0.0)
guid: String (0.0)
guid_isPermaLink: String (0.0)
pubDate: String (0.0)
description: String (0.0)

#2 Updated by peter larson over 5 years ago

According to the following, GeoJSON in QGIS has supported multiple types since 2015:

https://gis.stackexchange.com/questions/30427/opening-geojson-file-with-mixed-geometries-in-qgis

I've also used the following site to validate the JSON:

https://codebeautify.org/jsonviewer/cb5d91f9

It says its valid, but I don't know how reliable it is. I've attached the geoJSON file from the site.

#3 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

peter larson wrote:

According to the following, GeoJSON in QGIS has supported multiple types since 2015:

the geojson you posted does contains 2 layers, one point layer that can be loaded without issues in QGIS and one layer that is a geometry collection, not supported in QGIS (as in many other Desktop GIS packages). The "collection" the post refers are geojson files that contain multiple layers (that can be loaded individually without issues, given each one is a point/line/polygon layer), a geometry collection is a different thing, is a (1) layer that contains geometries of different types (points, line and polygons) mixed togeteher.

Also available in: Atom PDF