|
The first step when trying to import something is to read the user manual topic(s) on importing/linking that format. If something unexpected happens on import, there are three key questions to answer why something that claims to be a standard format does not import as you expect when you use dataports that are designed to import standard formats. 1. What software was used to create that file? 2. What format is it claimed to be? 3. What does the file actually contain? Saying a file is a "json" file means nothing when it comes to importing geospatial data, because JSON is just a notation style for writing about data. It can be whatever you want it to be. The following is a JSON file: { "todaysdate":"I think it's a Saturday", "todaysyear": { "exact":"Not sure, but maybe it's in the Age of Aquarius" }, "fields": "I like wheat fields, before they are cut and get filled with yucky stubble", "features": "There's a pink blob in the drawing but when I move the mouse it disappears" } ...it's also complete nonsense. That somebody uses JSON notation doesn't mean the text that is contained in a file with a .json extension has to make any sense or use any generally agreed upon standard. That's why the GeoJSON topic comments... The GeoJSON and JSON dataports are different, since GeoJSON is a well-specified standard, while a generic JSON file need not follow any standard for data organization. As a practical matter, JSON files are thus useful for interchanging tables in relatively calm use of JSON, such as arrays.
and why the JSON topic comments... JSON files vary wildly - In the above example we imported a JSON file that used JSON in a relatively simple way, to store a table. If the file had only three records, we could open it in Notepad (JSON files are plain text files) and see: [{"id":1,"first_name":"Hermina","last_name":"Stanworth","email":"hstanworth0@dailymotion.com","gender":"Female"}, {"id":2,"first_name":"Ellyn","last_name":"Wildash","email":"ewildash1@yellowbook.com","gender":"Female"}, {"id":3,"first_name":"Karna","last_name":"Collison","email":"kcollison2@accuweather.com","gender":"Female"}] JSON files can, and sometimes do, structure data using arrangements that make little sense except to software written by the original authors. In such cases, Manifold will use all sensible means to extract data that looks like it should be a table from the JSON file, and toss all other top level objects into comments components.
If we ask question number 3 above and take a look at your .json file with Notepad, we learn immediately it is not one of the two standards that use JSON to encode geographic data. It is neither a GeoJSON file nor a GeoJSONL file. How can we tell that? By reading the GeoJSON standard - the standard is written in very simple English and is easy to understand. Your file has things in it like this: "features": [ { "attributes": { "KAEK": "050097319007", "AREA": 952.72 }, "geometry": { "rings": [ [ [ 476096.74, 4202590.96 ... but there is no such thing as a "rings" in the GeoJSON standard. In fact, even if you're unwilling to read the GeoJSON standard you can search that web page and see the word "attributes" does not appear anywhere in the standard. GeoJSON does not use that word. So what you have is neither a GeoJSON file nor a GeoJSONL file. It's a "json" file in the generic sense of data organized by some scheme known to the author of the software that produced it and perhaps supported by some of his friends. Whatever it is, it doesn't seem to be widely supported. I tried importing it using GDAL and that was no go. I don't know what version of GDAL I have installed on the machine I used, but if it's not something GDAL from a couple of years ago didn't support (it's either that or the most recent version on my machine), then the organization of data in your json file is not exactly mainstream. ---- Some notes on the GeoJSON standard... 1. The standard does discuss rings, but only as a way of describing the structure of the fixed GeoJSON Polygon type, not as any sort of introduction of an alternate type. I get the feeling that whoever wrote the software which generated your .json file may not have been a native English speaker and thus got confused by that technical discussion about whether they could invent and use a "rings" type. Either that or, maybe, your file dates from an era before GeoJSON when people made up all sorts of things on the fly. 2. In the "you can't make this up..." department, the earnest authors of the GeoJSON standard after setting forth a more or less well defined standard go on to say, in effect, that if you don't like the standard you can ignore it, by writing: Members not described in this specification ("foreign members") MAY be used in a GeoJSON document. Note that support for foreign members can vary across implementations, and no normative processing model for foreign members is defined. Accordingly, implementations that rely too heavily on the use of foreign members might experience reduced interoperability with other implementations.
Well, it's not much of a standard if you can do something in it that depends upon telepathy for interoperability. 3. But they do redeem themselves, at least in part, by writing: Implementations MUST NOT extend the fixed set of GeoJSON types: FeatureCollection, Feature, Point, LineString, MultiPoint, Polygon, MultiLineString, MultiPolygon, and GeometryCollection.
So... no "rings". --- Bottom line: certainly not a bug, just a file that is not one of the standards for interchanging geographic data that Manifold (and, apparently, at least reasonably recent versions of GDAL) supports.
|