Re: [Geojson] Question regarding RFC 7946

Martin Daly <Martin.Daly@cadcorp.com> Mon, 18 March 2019 09:06 UTC

Return-Path: <Martin.Daly@cadcorp.com>
X-Original-To: geojson@ietfa.amsl.com
Delivered-To: geojson@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 691DE128766 for <geojson@ietfa.amsl.com>; Mon, 18 Mar 2019 02:06:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.333
X-Spam-Level:
X-Spam-Status: No, score=-1.333 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_IMAGE_RATIO_04=0.556, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_KAM_HTML_FONT_INVALID=0.01] autolearn=no autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cOsVdNTfZ3wx for <geojson@ietfa.amsl.com>; Mon, 18 Mar 2019 02:06:31 -0700 (PDT)
Received: from estocolmo.mep.pandasecurity.com (estocolmo.mep.pandasecurity.com [92.54.22.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 17208126D00 for <geojson@ietf.org>; Mon, 18 Mar 2019 02:06:29 -0700 (PDT)
Received: from [195.99.130.66] (helo=SRV016VEX.cadcorp.net) by estocolmo.mep.pandasecurity.com with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from <Martin.Daly@cadcorp.com>) id 1h5oDl-0007nH-4t; Mon, 18 Mar 2019 10:06:18 +0100
Received: from SRV016VEX.cadcorp.net (10.0.0.6) by SRV016VEX.cadcorp.net (10.0.0.6) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Mon, 18 Mar 2019 09:06:53 +0000
Received: from SRV016VEX.cadcorp.net ([::1]) by SRV016VEX.cadcorp.net ([::1]) with mapi id 15.00.1104.000; Mon, 18 Mar 2019 09:06:53 +0000
X-Envelope-From: Martin.Daly@cadcorp.com
From: Martin Daly <Martin.Daly@cadcorp.com>
To: "'V. Kelly Bellis'" <kellybellis@gwi.net>, "geojson@ietf.org" <geojson@ietf.org>
Thread-Topic: [Geojson] Question regarding RFC 7946
Thread-Index: AQHU3RGpN7/nopmI90KV1QekfKApD6YRF/jQ
Date: Mon, 18 Mar 2019 09:06:53 +0000
Message-ID: <b95480321c1e498189ec72533a0b4c9f@SRV016VEX.cadcorp.net>
References: <86310cf6-e2d8-6c59-c845-b9862ba414a1@gwi.net> <CAOoFiBbxxH0h3xA=i_+G94Feb-Mh6yEfTEw71o-HH=tCkiU=Xg@mail.gmail.com> <589847ca-db3d-853e-1142-cbe0b3e61da5@gwi.net>
In-Reply-To: <589847ca-db3d-853e-1142-cbe0b3e61da5@gwi.net>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.0.1.2]
Content-Type: multipart/related; boundary="_009_b95480321c1e498189ec72533a0b4c9fSRV016VEXcadcorpnet_"; type="multipart/alternative"
MIME-Version: 1.0
X-CTCH-IPCLASS: G2
X-SPF-Received: 5
X-Spamina-Bogosity: Unsure
Archived-At: <https://mailarchive.ietf.org/arch/msg/geojson/hnNddYVMVIqjhF-OQUlELE0_r40>
Subject: Re: [Geojson] Question regarding RFC 7946
X-BeenThere: geojson@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IETF GeoJSON WG <geojson.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/geojson>, <mailto:geojson-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/geojson/>
List-Post: <mailto:geojson@ietf.org>
List-Help: <mailto:geojson-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/geojson>, <mailto:geojson-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Mar 2019 09:06:34 -0000

You have no “FeatureCollection” object, and therefore no “features” array. Your “properties” object does not have commas between consecutive key/value pairs. That’s two problems to be going on with.

You can use jsonlint.com and geojsonlint.com to check your output, which may give clearer errors than you have been getting.

Martin


From: GeoJSON <geojson-bounces@ietf.org> On Behalf Of V. Kelly Bellis
Sent: 16 March 2019 16:52
To: geojson@ietf.org
Subject: [Geojson] Question regarding RFC 7946


Hello geojson@ietf.org<mailto:geojson@ietf.org>

Trying to get OpenWeatherMap's list cities into the GeoJSON format has been a great excuse to get reacquainted with regex; however (after two days of failures), I'm wondering: is there a better way?



OpenWeatherMap.org<https://openweathermap.org/> uses a list of cities by ID: http://bulk.openweathermap.org/sample/city.list.json.gz

Typical format contained in city.list.json

[cid:image001.png@01D4DD69.22CB7250]



I first thought a typical record looks similar to the format in GeoJSON<http://geojson.org/>, but not similar enough for Global Mapper which can read GeoJSON files. Here is the result after attempting to read the original OWM format:
[cid:image002.png@01D4DD69.22CB7250]



After starting with the easy change of finding "coords" and changing to "coordinates", I eventually developed:

Find: ^  {\n    "id": ([0-9]*),\n    "name": "([A-Za-z\u00C0-\u017F&\s\'\‘\’]*)",\n    "country": "([A-Z]*)",\n    "coordinates": {\n      "lon": ([-]*)([0-9]*.[0-9]*),\n      "lat": ([-]*)([0-9]*.[0-9]*)\n    }\n  },\n

Replace with: {\n  "type": "Feature",\n  "geometry": {\n    "type": "Point",\n    "coordinates": [\4\5, \6\7]\n  },\n  "properties": {\n    "city_name": "\2"\n    "country_code": "\3"\n    "owm_id": "\1"\n  }\n},\n

From what I've gathered, it is closer to being in the (attached) geojson format (though I haven't dared try and parse https://tools.ietf.org/html/rfc7946 as it's a bit intimidating), but still it fails. And what little I read of it, GeoJSON generally appears to be unforgiving and laden with rigidities.

I've been testing using only regex and a small sample of OpenWeatherMap records wherein I added algebraic signs; i.e., tossed in a couple minus symbols for lon and lat, and added some odd characters, found naturally in the larger dataset.

Here's a before and after screen:

[cid:image003.png@01D4DD69.22CB7250]



Still, Global Mapper balked at my reformatting:

[cid:image004.png@01D4DD69.22CB7250]



At this point, I'm not sure what else I can do to get GM to read the OWM stuff. And to be clear, this was more of an educational lark than anything, all stemming from simply wanting to know the OWM city IDs in a given area.


FWIW, I also wrote to info@openweathermap.org<mailto:info@openweathermap.org> asking:

  1.  Why isn't OWM's format the same as the standard GeoJSON?
  2.  And in followup, could you please consider offering the city id list in GeoJSON format in addition to your own OWM format?

Also, I'm in close contact with Blue Marble Geographics.

Maybe I'll hear from them next week..

Thank you! :)

Kind regards,

Kelly



On 3/15/2019 11:29 AM, Mike Childs wrote:
Hi Kelly,

Their .json file is indeed slightly different than the standard GeoJSON format. I'm not sure whey they chose to get so close to the actual standard but then modify a few things.

Our GeoJSON import capabilities come from a 3rd-party library (GDAL), so we'd need them to add support for this flavor, or you could modify the file directly in a text editor to match the expected format.

I think you could start by changing "coords" to "coordinates", but more may be needed.

Best Regards,

Mike Childs | Global Mapper Guru
Blue Marble Geographics
www.bluemarblegeo.com<http://www.bluemarblegeo.com/?utm_source=signature&utm_medium=email&utm_campaign=website>

22 Carriage Lane
Hallowell, ME 04347 USA
Phone: +1 (207) 622-4622
Toll Free: (800) 616-2725
Email: geohelp@bluemarblegeo.com<mailto:geohelp@bluemarblegeo.com>

Please note, support@globalmapper.com<mailto:support@globalmapper.com> is no longer an active email - please update your tech support contact to geohelp@bluemarblegeo.com<mailto:geohelp@bluemarblegeo.com>.
[Image removed by sender. Blue Marble GeoTalks on March 21,                                  2019]<http://www.bluemarblegeo.com/bmuc/index.php?aid=siggeotalks01152019&utm_source=signature&utm_medium=email&utm_campaign=geotalks_2019&utm_term=http://www.bluemarblegeo.com/bmuc/index.php&utm_content=signature>

[Image removed by sender. Follow us:]

[Image removed by sender. Facebook]<https://www.facebook.com/bluemarble.geographics>

[Image removed by sender. Twitter]<https://twitter.com/BlueMarbleGeo>

[Image removed by sender. LinkedIn]<http://www.linkedin.com/company/blue-marble-geographics>

[Image removed by sender. YouTube]<http://www.youtube.com/user/BlueMarbleWebinars>

[Image removed by sender. Instagram]<https://www.instagram.com/bluemarblegeo/>


The information in this email message is legally privileged and confidential information intended only for the use of the individual(s) named above. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this email. If you have received this email in error, please notify the sender and delete all copies of the message promptly. Thank you.


On Fri, Mar 15, 2019 at 8:38 AM V. Kelly Bellis <kellybellis@gwi.net<mailto:kellybellis@gwi.net>> wrote:

OpenWeatherMap.org<https://openweathermap.org/> uses a list of cities by ID: http://bulk.openweathermap.org/sample/city.list.json.gz

Typical format contained in city.list.json
[cid:image001.png@01D4DD69.22CB7250]

A typical record looks similar to the format in GeoJSON, but not similar enough for Global Mapper.

[cid:image002.png@01D4DD69.22CB7250]



Doubt there's much public need for this, and am just curious - Is it too much bother to expand GM's format choices to include OWM's json? I'll give TextPad and regex  a try just for fun! :)

Thank you! :)

Kind regards,

Kelly

--
V. Kelly Bellis, PLS
17 Union Street
Ellsworth, ME 04605

Precisely Determining True North<https://www.youtube.com/watch?v=zMwDkzl43n8> without a surveyor!
--
V. Kelly Bellis, PLS
17 Union Street
Ellsworth, ME 04605

Precisely Determining True North<https://www.youtube.com/watch?v=zMwDkzl43n8> without a surveyor!