[GRASS-dev] Re: [GRASS-user] create a xy location with g.proj

Paul Kelly paul-grass at stjohnspoint.co.uk
Fri Oct 12 11:20:46 EDT 2007


On Thu, 11 Oct 2007, Maciej Sieczka wrote:

> Hamish wrote:
>>> Peter Löwe wrote:
>>>> does anybody have an example how to create a xy-location using g.proj
>>>> -c ?
>>>>
>>>> Calling up g.proj from within a xy-location using the -j/-w flags (to
>>>> create output in wkt/proj format) results in the info "xy location
>>>> (unprojected)". This doesn't really help.
>>
>> Michael Barton wrote:
>>> AFAIK, you cannot create an xy location using g.proj. g.proj is for
>>> creating projected locations. xy is not projected. When I wanted to
>>> create an xy location for the new wxPython location wizard, I had to
>>> code it myself. That said, it's not hard to create the WIND, etc files
>>> for an xy location.
>
>> If this doesn't exist, then we should look at adding the functionality.
>>
>> for example:
>>  g.proj -c location="newloc" wkt=none
>> or
>>  g.proj -c location="newloc" wkt=XY
>> or
>>  g.proj -c location="newloc" wkt=unprojected
>
> It's a good idea IMO. But I'd suggest not to mix WKT with
> this - WKT has it's strict meaning (there's no WKT
> representation for GRASS XY location settings AFAIK; is
> there?). Moreover, wkt= parameter is supposed to be a file.
> How about this: if -c is used and no wkt, georef or proj4
> parameters are given, assume XY?
>
> BTW, I noticed a following sentence in g.proj manual
> regarding georef option: "If the file is not georeferenced
> or cannot be read, XY (unprojected) will be used". But it
> does not work:

That's true. It's a documentation bug. If you export a Shapefile and then 
delete the .prj file that was created, then try to use that Shapefile as 
the georeferenced source, you should be able to create an XY location. 
g.setproj can also do that though (not sure if anybody else mentioned 
that).

Paul


More information about the grass-dev mailing list