[OSGeo-Discuss] Parsing well-known text

Bruce Bannerman bruce.bannerman.osgeo at gmail.com
Sun Sep 6 15:31:31 PDT 2020


Hello Pierre,

It is dangerous to assume what the coordinates in a data set represent. It may not have implications for your particular use, but could have serious consequences for other uses downstream.

A good approach is to consult the discovery metadata that describes the dataset that you are using. It should help you to interpret the data. Any good data provider will also provide discovery metadata, typically in ISO 19115 format (or derivative).

If such metadata is not available, ask the data provider to better define their data, in your case, the spatial reference system used. If they can’t, or won’t provide this information then I would question the need to use that data set and look for an alternative, as the data quality is suspect.

It is important that blind assumptions of what an unqualified coordinate in a spatial reference system means is not built into software that will be used by others without explicitly stating that this is what is being done. 

Kind regards,

Bruce


> On 7 Sep 2020, at 02:53, Pierre Abbat <phma at bezitopo.org> wrote:
> 
> On Wednesday, 2 September 2020 05:41:40 EDT Even Rouault wrote:
>> As far as I know, you can't create a CRS WKT with just unit information. The
>> most minimal content that validates the WKT1 grammar would be something
>> like:
>> 
>> LOCAL_CS["unspecified CRS",
>>    LOCAL_DATUM["unspecified datum",2000],
>>    UNIT["metre",1,
>>        AUTHORITY["EPSG","9001"]],
>>    AXIS["Easting",EAST],
>>    AXIS["Northing",NORTH]]
> 
> That doesn't seem to have an elevation unit; should I assume that they're both 
> meters?
> 
>> Yes, PROJ >= 6 has support for parsing and creating WKT in several versions
>> of the WKT standard.
>> 
>> See proj_create_from_wkt() at
>> https://proj.org/development/reference/functions.html, and all other
>> proj_XXXX getters.
>> 
>> For creation of WKT, you might need the more advanced functions of
>> https://github.com/OSGeo/PROJ/blob/master/src/proj_experimental.h , before
>> exporting with proj_as_wkt()
> 
> That's overkill for what I'm doing. I don't need to make a projection, all I 
> need to know is the units. I don't need to create a WKT except in the case 
> that the original cloud doesn't have one and I'm adding one to specify the 
> units.
> 
> The code to parse the WKT is in YACC, which I don't know how to work with, and 
> I don't need all the tokens. Treating them as opaque atoms and looking for 
> "UNIT" should work. Where can I find the grammar of the language of which WKT 
> is an instance?
> 
> Adding any library multiplies the complexity of building and packaging on 
> Windows. PROJ is 79 times as big as Wolkenbase so far and 17 times as big as 
> PerfectTIN. Even Bezitopo, which handles projections, but only conformal ones, 
> is only 1/7 as big as PROJ, by running du on the source trees with .git 
> included.
> 
> Pierre
> -- 
> When a barnacle settles down, its brain disintegrates.
> Já não percebe nada, já não percebe nada.
> 
> 
> 
> _______________________________________________
> Discuss mailing list
> Discuss at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/discuss


More information about the Discuss mailing list