[GRASS-user] Projection problems with EU soil data

The ESDB data here available:

http://eusoils.jrc.ec.europa.eu/ESDB_Archive/ESDB_Data_Distribution/ESDB_data.html

still have a peculiar LAEA projection with spherical ellipsoid as
explained here:

http://eusoils.jrc.ec.europa.eu/gisco_dbm/dbm/home.htm
(see The Lambert Azimuthal Equal Area projection)
and indeed this is the output of ogrinfo about them:

---8<----------------------------------------------------------------------------
INFO: Open of `sgdbe4_0.shp'
      using driver `ESRI Shapefile' successful.

Layer name: sgdbe4_0
Geometry: Polygon
Feature Count: 51729
Extent: (-1594087.250000, -1350119.375000) - (5100808.000000, 7673966.500000)
Layer SRS WKT:
PROJCS["User_Defined_Lambert_Azimuthal_Equal_Area",
    GEOGCS["GCS_User_Defined",
        DATUM["User_Defined",
            SPHEROID["User_Defined_Spheroid",6378388.0,0.0]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Lambert_Azimuthal_Equal_Area"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",9.0],
    PARAMETER["Latitude_Of_Origin",48.0],
    UNIT["Meter",1.0]]
AREA: Real (13.3)
PERIMETER: Real (13.3)
SOIL_: Real (11.0)
SOIL_ID: Real (11.0)
SMU: Integer (7.0)
STU_DOM: Integer (7.0)
PCAREA: Real (20.6)
---8<----------------------------------------------------------------------------

I created a custom ellipsoid and a correct location to host them as follows:
(g.proj -j output:)

+proj=laea
+lat_0=48.0000000000
+lon_0=9.0000000000
+x_0=0.0000000000
+y_0=0.0000000000
+a=6378388
+b=6378388
+no_defs
+towgs84=0,0,0

I guess, I had to use the same center of WGS84 (maybe not?)

The problem is that the resulting data are south apparently shifted of about 22 km,
which is quite bad for a 1x1 km grid like that.

Anyone had the same experience with those data? Any advice?

--
Francesco P. Lovergine

On Fri, Dec 03, 2010 at 11:51:06AM +0100, Francesco P. Lovergine wrote:

The problem is that the resulting data are south apparently shifted of about 22 km,
which is quite bad for a 1x1 km grid like that.

Sorry, the shift is in *north* direction. It results so by reprojecting
VMAP0 country borders in the custom location.

--
Francesco P. Lovergine

On Fri, Dec 03, 2010 at 11:51:06AM +0100, Francesco P. Lovergine wrote:

The ESDB data here available:

http://eusoils.jrc.ec.europa.eu/ESDB_Archive/ESDB_Data_Distribution/ESDB_data.html

still have a peculiar LAEA projection with spherical ellipsoid as
explained here:

http://eusoils.jrc.ec.europa.eu/gisco_dbm/dbm/home.htm
(see The Lambert Azimuthal Equal Area projection)
and indeed this is the output of ogrinfo about them:

I finally found that the accompanying .prj are simply outdated.
The projection used adopts a GRS80 ellipsoid as in ETRS89, but still
use the same parameters for the rest.

+proj=laea
+lat_0=48.0000000000
+lon_0=9.0000000000
+x_0=0.0000000000
+y_0=0.0000000000
+a=6378137
+rf=298.257222101
+no_defs
+to_meter=1.0

--
Francesco P. Lovergine

I've wrote a simple python module working in grass 7 under linux (It's only one file). Could anyone help me how can I try it under wingrass 7? Is not clear for me the install procedure for python module.
thanks in advance.

Well, excuse me if I was not clear in previous message. I'll try to give more info:
In grass 7 for linux my python module works fine. In wingrass70 I've copied my module in %GISSBASE%/scripts but it doesn't works.
I get that message:
c:\Progrm Files\GRASS-70-SVN\extralibin\python.exe: can't open file '%GISBASE%/scripts/r.mcda.roughset.py':[Errno 2] No such file or directory'
I've read some precedent post but the suggest solutions works for 6.4 and in 7.0 I've the same problem.

Thanks

Il 11/12/2010 20.24, gianluca.massei ha scritto:

I've wrote a simple python module working in grass 7 under linux (It's only one file). Could anyone help me how can I try it under wingrass 7? Is not clear for me the install procedure for python module.
thanks in advance.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

-----
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 10.0.1170 / Database dei virus: 426/3309 - Data di rilascio: 11/12/2010

On 12/13/2010 02:28 PM, gianluca.massei wrote:

Well, excuse me if I was not clear in previous message. I'll try to
give more info:
In grass 7 for linux my python module works fine. In wingrass70 I've
copied my module in %GISSBASE%/scripts but it doesn't works.
I get that message:
c:\Progrm Files\GRASS-70-SVN\extralibin\python.exe: can't open file
'%GISBASE%/scripts/r.mcda.roughset.py':[Errno 2] No such file or directory'
I've read some precedent post but the suggest solutions works for 6.4
and in 7.0 I've the same problem.

Thanks

Il 11/12/2010 20.24, gianluca.massei ha scritto:

I've wrote a simple python module working in grass 7 under linux (It's
only one file). Could anyone help me how can I try it under wingrass
7? Is not clear for me the install procedure for python module.
thanks in advance.

Are you sure that GISSBASE is defined in your system paths? Also are you
using the GRASS installer or the OSGeo4w installer, the OSGeo4w contains
a shell that ensures all those paths work as they should, not sure about
the regular GRASS installer.

What solution did you see for 6.4? Did you try it and did it not work?

Thanks,
Alex

Hy,
I'm using Grass installer and I've set GISBASE in my system path. I've tried this procedure without any results:
http://www.mail-archive.com/grass-user@lists.osgeo.org/msg16242.html

Thanks for your help

Il 13/12/2010 23.50, Alex Mandel ha scritto:

On 12/13/2010 02:28 PM, gianluca.massei wrote:

Well, excuse me if I was not clear in previous message. I'll try to
give more info:
In grass 7 for linux my python module works fine. In wingrass70 I've
copied my module in %GISSBASE%/scripts but it doesn't works.
I get that message:
c:\Progrm Files\GRASS-70-SVN\extralibin\python.exe: can't open file
'%GISBASE%/scripts/r.mcda.roughset.py':[Errno 2] No such file or directory'
I've read some precedent post but the suggest solutions works for 6.4
and in 7.0 I've the same problem.

Thanks

Il 11/12/2010 20.24, gianluca.massei ha scritto:

I've wrote a simple python module working in grass 7 under linux (It's
only one file). Could anyone help me how can I try it under wingrass
7? Is not clear for me the install procedure for python module.
thanks in advance.

Are you sure that GISSBASE is defined in your system paths? Also are you
using the GRASS installer or the OSGeo4w installer, the OSGeo4w contains
a shell that ensures all those paths work as they should, not sure about
the regular GRASS installer.

What solution did you see for 6.4? Did you try it and did it not work?

Thanks,
Alex

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

-----
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 10.0.1170 / Database dei virus: 426/3313 - Data di rilascio: 13/12/2010

I’ve repeated all the procedure [0] and now I’ve this error when I run my module:

import grass.script as grass
Traceback (most recente call last):
File “(stdin)”, line 1, in (module)
ImportError: No module named grass.script

I run Python from MSYS and I try:

import grass.script as grass

and I get the same error message

[0]http://www.mail-archive.com/grass-user@lists.osgeo.org/msg16242.html

well, may be I’m very boring… but I can’t solve my problem!
Now if I run my script I get this message:

GRASS 7.0.svn> r.mcda.roughset.py
Traceback (most recent call last):
File “C:\Program Files\GRASS-70-SVN/etc/gui/wxpython/gui_modules/menuform.py”,
line 2383, in
task = grassTask(cmd[0])
File “C:\Program Files\GRASS-70-SVN/etc/gui/wxpython/gui_modules/menuform.py”,
line 394, in init
processTask(tree = etree.fromstring(getInterfaceDescription(grassModule)),
File “C:\OSGeo4W\apps\Python25\lib\xml\etree\ElementTree.py”, line 964, in XML

return parser.close()
File “C:\OSGeo4W\apps\Python25\lib\xml\etree\ElementTree.py”, line 1254, in cl
ose
self._parser.Parse(“”, 1) # end of data
xml.parsers.expat.ExpatError: no element found: line 1, column 0
GRASS 7.0.svn>

gianluca.massei wrote:

well, may be I'm very boring... but I can't solve my problem!
Now if I run my script I get this message:

GRASS 7.0.svn> r.mcda.roughset.py

     self._parser.Parse("", 1) # end of data
xml.parsers.expat.ExpatError: no element found: line 1, column 0

This usually indicates that running the script with the
--interface-description flag failed to generate an XML interface
description.

Ensure that the script has the module and option descriptions at the
top of the file and the grass.parser() call at the bottom of the file:

  if __name__ == "__main__":
      options, flags = grass.parser()
      main()

with nothing else at the top-level (outside of any function
defintion).

If that isn't sufficient, check that that the .py extension is
registered correctly. You should be able to "execute" a Python script
from the Windows command prompt by typing its name.

   File "C:\OSGeo4W\apps\Python25\lib\xml\etree\ElementTree.py", line

If the extension is registered to an official version of Python, I
suggest that you don't change that, but manually edit the startup
scripts to use the official version rather than the OSGeo4W version.
You may need to install wxPython, NumPy and/or PyWin32.

If the extension isn't registered at all, I suggest installing Python
using the installer from python.org, then following the above
paragraph.

--
Glynn Clements <glynn@gclements.plus.com>

Thanks Glynn for help,
now .py extension is registered correctly and my module ends with correct code but The error message is the same. In linux (ubuntu 10.4 LTS) all works fine but in windows my module and all other python standard modules (e.g. r.mask) return same error. If I set PYTHONPAT=C:\Python27 I have this message " [...] no module named grass.script"

thanks

Il 15/12/2010 0.28, Glynn Clements ha scritto:

Ensure that the script has the module and option descriptions at the
top of the file and the grass.parser() call at the bottom of the file:

  if __name__ == "__main__":
      options, flags = grass.parser()
      main()

with nothing else at the top-level (outside of any function
defintion).
If that isn't sufficient, check that that the .py extension is
registered correctly. You should be able to "execute" a Python script
from the Windows command prompt by typing its name.

    File "C:\OSGeo4W\apps\Python25\lib\xml\etree\ElementTree.py", line

If the extension is registered to an official version of Python, I
suggest that you don't change that, but manually edit the startup
scripts to use the official version rather than the OSGeo4W version.
You may need to install wxPython, NumPy and/or PyWin32.

If the extension isn't registered at all, I suggest installing Python
using the installer from python.org, then following the above
paragraph.

gianluca.massei wrote:

now .py extension is registered correctly and my module ends with
correct code but The error message is the same. In linux (ubuntu 10.4
LTS) all works fine but in windows my module and all other python
standard modules (e.g. r.mask) return same error. If I set
PYTHONPAT=C:\Python27 I have this message " [...] no module named
grass.script"

PYTHONPATH should contain the path to GRASS' Python directory, i.e.
%GISBASE%\etc\python. It shouldn't contain any other entries.

PYTHONHOME should not be set.

PATH shouldn't need an entry for Python.

GRASS_PYTHON should contain the complete path to the Python
interpreter.

--
Glynn Clements <glynn@gclements.plus.com>