Re: [GRASS-user] pyhton script-how to get the pixel value from r.what

2012-03-28 Thread Adam Dershowitz, Ph.D., P.E.


On Mar 28, 2012, at 2:38 PM, tigrida wrote:

 Hello!
 
 I am writing a python script, and I want to do mathematical operations with
 some pixels, but I can't. Can anyone help me?
 
 
 script:
 ts_f= grass.read_command(r.what,input=Ts, east_north= %s,%s %
 (eastF,northF))
 print Ts pixel frio=,ts_f
 lambda_f=(2.501-(0.00236*(ts_f-273.15)))*100
 
 error:
 Ts pixel frio= 180740.539419|2399806.55602||290.266289112492
 
 Traceback (most recent call last):
  File vslp2.py, line 284, in module
lambda_f=(2.501-(0.00236*(ts_f-273.15)))*100
 TypeError: unsupported operand type(s) for -: 'str' and 'float'
 
 
 I really appreciate any suggestions
 
 
 



It looks like the grass.read_command returns a string, and you are then trying 
to do math on it.
You probably want something like:

import string
ts_f= grass.read_command(r.what,input=Ts, east_north= %s,%s %
(eastF,northF))
print Ts pixel frio=,ts_f
ts_values=string.split(ts_f,'|')

I am not sure which value you then want.  Probably ts_values[3]:

lambda_f=(2.501-(0.00236*(ts_values[3]-273.15)))*100
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] r.viewshed build

2011-10-10 Thread Adam Dershowitz, Ph.D., P.E.


On Oct 10, 2011, at 12:51 AM, Glynn Clements wrote:

 
 Adam Dershowitz, Ph.D., P.E. wrote:
 
 I just tried to build and run r.viewshed.  When I build it, it seems to
 compile fine, but then latter in the make process, I saw this error go
 past:
 
 MM error: limit =0B. allocating 16B. limit exceeded by 24B.
 Assertion failed: (0), function operator new, file mm.cc, line 326.
 
 Any thoughts or suggestions what might be going on with this?
 
 Something is trying to allocate memory before the memory manager
 object has been initialised.
 
 The order in which static objects are constructed is undefined. So if
 a static object dynamically allocates memory in its constructor, it's
 a matter of luck whether the memory manager object has been
 constructed at that point.
 
 Fortunately, the MM_register class doesn't actually need construction. 
 Unfortunately, the limit-checking mode is statically initialised to
 abort, then changed to ignore in the constructor.
 
 This has (hopefully) been fixed in 7.0 with r38702, but the problem
 remains in 6.x.
 
 The fix involves changing line 443 of lib/iostream/mm.cc from:
 
   MM_mode MM_register::register_new = MM_ABORT_ON_MEMORY_EXCEEDED; 
 to:
   MM_mode MM_register::register_new = MM_IGNORE_MEMORY_EXCEEDED;
 
 -- 
 

Thanks.
I assume that means 1)  the only way to fix this is to recompile the grass 
iostream static library?  (I have been using the binary of grass).  2)  Will 
the same change work in 6.x?  Or would the change potentially introduce other 
problems or be more complicated?

--Adam

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


[GRASS-user] r.viewshed build

2011-10-09 Thread Adam Dershowitz, Ph.D., P.E.
I just tried to build and run r.viewshed.  When I build it, it seems to compile 
fine, but then latter in the make process, I saw this error go past:

MM error: limit =0B. allocating 16B. limit exceeded by 24B.
Assertion failed: (0), function operator new, file mm.cc, line 326.


However, after that, it does apparently complete the build and generate a 
binary.  But, if I try to run the binary, I get exactly that error.  Even just 
trying to get help:

 r.viewshed  -h
MM error: limit =0B. allocating 16B. limit exceeded by 24B.
Assertion failed: (0), function operator new, file mm.cc, line 326.
Abort trap

So, it seems that something is odd with build.  
I am running on a Mac, using Kyngchaos binaries and modbuild.  So, the make 
command I used is just:
make GRASS_HOME='/Users/dersh/Library/GRASS/6.4/modbuild' 
GRASS_APP='/Applications/GRASS-6.4.app'

Any thoughts or suggestions what might be going on with this?
I really am not sure if it is an issue with r.viewshed, GRASS, Mac version, mac 
building etc?

Thanks for any ideas.



--Adam



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


[GRASS-user] Import/conversion problem

2011-02-11 Thread Adam Dershowitz, Ph.D., P.E.
I am trying to import some data in GRASS and have run into a problem.  I hope 
someone can give me a little insight to help out.
I downloaded some aerial imagery from here:
http://www.michigan.gov/dnr/0,1607,7-153-10371_14546-30211--,00.html

I want to import it into a UTM zone 17 project.  So I did the following:
gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' input.sid output_utm.sid

gdapwarp responds with an error, but then continues with the conversion:
ERROR 6: Failed to initialize PROJ.4 with `+proj=omerc +lat_0=0 +lonc=0 
+alpha=0 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs '.
lat_0 = 0 or 90 or alpha = 90
0...10...20...30...40...50...60...70...80...90...100 - done.

If I then try to import the image, into my project, it does work, but places it 
WAY off from where it should be (millions of meters!).  I guess I should not be 
surprised, since the error says that it is trying to use a lat/long of 0.  But 
I don't understand why it is not working correctly.  

So, clearly something is wrong with how I am doing the conversion.  Am I 
missing a flag or something?  It looks to me like gdalinfo is doing a correct 
read, but somehow gdalwarp is missing something on the input.
Any help would be greatly appreciated.  

If I do gdalinfo on the input file, here is what I get:

Driver: MrSID/Multi-resolution Seamless Image Database (MrSID)
Files: oakgrove_sw.sid
   oakgrove_sw.sdw
   oakgrove_sw.sid.aux.xml
Size is 6415, 8061
Coordinate System is:
PROJCS[IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
Projection = Oblique Mercator (Hotine)|IMAGINE,
GEOGCS[NAD83,
DATUM[North_American_Datum_1983,
SPHEROID[GRS 1980,6378137,298.2572221010002,
AUTHORITY[EPSG,7019]],
AUTHORITY[EPSG,6269]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4269]],
PROJECTION[Hotine_Oblique_Mercator],
PARAMETER[latitude_of_center,0],
PARAMETER[longitude_of_center,0],
PARAMETER[azimuth,0],
PARAMETER[rectified_grid_angle,90],
PARAMETER[scale_factor,1],
PARAMETER[false_easting,0],
PARAMETER[false_northing,0],
UNIT[metre,1,
AUTHORITY[EPSG,9001]]]
Origin = (663144.500,240035.500)
Pixel Size = (1.000,-1.000)
Metadata:
  IMAGE__INPUT_NAME=K:\blk18\oakgrove_sw.tif
  IMAGE__INPUT_FILE_SIZE=155199578.00
  GEOTIFF_NUM__1024__GTModelTypeGeoKey=1
  GEOTIFF_CHAR__GTModelTypeGeoKey=ModelTypeProjected
  GEOTIFF_NUM__1025__GTRasterTypeGeoKey=1
  GEOTIFF_CHAR__GTRasterTypeGeoKey=RasterPixelIsArea
  GEOTIFF_NUM__1026__GTCitationGeoKey=IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
Projection = Oblique Mercator (Hotine)|IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
Projection Name = Oblique Mercator (Hotine)
Units = meters
GeoTIFF Units = meters|
  GEOTIFF_NUM__2048__GeographicTypeGeoKey=4269
  GEOTIFF_CHAR__GeographicTypeGeoKey=GCS_NAD83
  GEOTIFF_NUM__2060__GeogAzimuthUnitsGeoKey=9102
  GEOTIFF_CHAR__GeogAzimuthUnitsGeoKey=Angular_Degree
  GEOTIFF_NUM__3072__ProjectedCSTypeGeoKey=32767
  GEOTIFF_CHAR__ProjectedCSTypeGeoKey=User-Defined
  GEOTIFF_NUM__3073__PCSCitationGeoKey=IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
Projection = Oblique Mercator (Hotine)|IMAGINE GeoTIFF Support
Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
Projection Name = Oblique Mercator (Hotine)
Units = meters
GeoTIFF Units = meters|
  GEOTIFF_NUM__3074__ProjectionGeoKey=32767
  GEOTIFF_CHAR__ProjectionGeoKey=User-Defined
  GEOTIFF_NUM__3075__ProjCoordTransGeoKey=3
  GEOTIFF_CHAR__ProjCoordTransGeoKey=CT_ObliqueMercator
  GEOTIFF_NUM__3076__ProjLinearUnitsGeoKey=9001
  GEOTIFF_CHAR__ProjLinearUnitsGeoKey=Linear_Meter
  
GEOTIFF_NUM__3088__ProjCenterLongGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.00
  
GEOTIFF_NUM__3089__ProjCenterLatGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.00
  
GEOTIFF_NUM__3090__ProjCenterEastingGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.00
  
GEOTIFF_NUM__3091__ProjCenterNorthingGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.00
  
GEOTIFF_NUM__3093__ProjScaleAtCenterGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.00
  
GEOTIFF_NUM__3094__ProjAzimuthAngleGeoKey=0.999600,45.309167,2546731.496000,-4354009.816000,337.255560,-86.00
  IMAGE__Z_RESOLUTION=0.00
  GEO__ModelTypeGeoKey=1
  

Re: [GRASS-user] Import/conversion problem

2011-02-11 Thread Adam Dershowitz, Ph.D., P.E.
I am also working on OS X.  But, I am using the MrSID plugin, from William 
Kyngesburye.  So it seems that both gdalwarp and r.in.gdal are willing to 
import it.  But, maybe I will try to search around for the apps that you are 
referring to, to see if they might do a better job on the conversion.  
Are you suggesting that the MrSID plugin that I have is working, but is loosing 
reference data along the way?

--Adam



On Feb 11, 2011, at 10:47 AM, Stuart Edwards wrote:

 MrSID files are a bit tricky.  This is a proprietary format owned by 
 LizardTech (see http://www.gdal.org/frmt_mrsid.html).  That being said, they 
 freely provide decode tools at their website (http://www.lizardtech.com/).  
 Working on OS X, I use their Raster_DSDK in a little command line routine to 
 convert the file to a geotiff (tifg) and then import it into GRASS with 
 r.in.gdal.  Note that the MrSID format is very efficient and boils a quad 
 down to about 1.5 Gb.  This will become 3 or 4 times greater as a tif so make 
 sure you have plenty of room to store it and process it.  I use an old 
 version of Expressview (a LizardTech viewer that used to be available for OS 
 X) to look at the image and determine the coordinates of the bit that I 
 really want in order to minimize the resulting file sizes.
 
 AFAIK there are no open source apps that deal with MrSID directly (for those 
 that do, you have to install your own version of the decoder first)
 
 Stu
 
 
 On Feb 11, 2011, at 12:23 PM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 I am trying to import some data in GRASS and have run into a problem.  I 
 hope someone can give me a little insight to help out.
 I downloaded some aerial imagery from here:
 http://www.michigan.gov/dnr/0,1607,7-153-10371_14546-30211--,00.html
 
 I want to import it into a UTM zone 17 project.  So I did the following:
 gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' input.sid output_utm.sid
 
 gdapwarp responds with an error, but then continues with the conversion:
 ERROR 6: Failed to initialize PROJ.4 with `+proj=omerc +lat_0=0 +lonc=0 
 +alpha=0 +k=1 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs '.
 lat_0 = 0 or 90 or alpha = 90
 0...10...20...30...40...50...60...70...80...90...100 - done.
 
 If I then try to import the image, into my project, it does work, but places 
 it WAY off from where it should be (millions of meters!).  I guess I should 
 not be surprised, since the error says that it is trying to use a lat/long 
 of 0.  But I don't understand why it is not working correctly.  
 
 So, clearly something is wrong with how I am doing the conversion.  Am I 
 missing a flag or something?  It looks to me like gdalinfo is doing a 
 correct read, but somehow gdalwarp is missing something on the input.
 Any help would be greatly appreciated.  
 
 If I do gdalinfo on the input file, here is what I get:
 
 Driver: MrSID/Multi-resolution Seamless Image Database (MrSID)
 Files: oakgrove_sw.sid
  oakgrove_sw.sdw
  oakgrove_sw.sid.aux.xml
 Size is 6415, 8061
 Coordinate System is:
 PROJCS[IMAGINE GeoTIFF Support
 Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
 @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
 Projection = Oblique Mercator (Hotine)|IMAGINE,
   GEOGCS[NAD83,
   DATUM[North_American_Datum_1983,
   SPHEROID[GRS 1980,6378137,298.2572221010002,
   AUTHORITY[EPSG,7019]],
   AUTHORITY[EPSG,6269]],
   PRIMEM[Greenwich,0],
   UNIT[degree,0.0174532925199433],
   AUTHORITY[EPSG,4269]],
   PROJECTION[Hotine_Oblique_Mercator],
   PARAMETER[latitude_of_center,0],
   PARAMETER[longitude_of_center,0],
   PARAMETER[azimuth,0],
   PARAMETER[rectified_grid_angle,90],
   PARAMETER[scale_factor,1],
   PARAMETER[false_easting,0],
   PARAMETER[false_northing,0],
   UNIT[metre,1,
   AUTHORITY[EPSG,9001]]]
 Origin = (663144.500,240035.500)
 Pixel Size = (1.000,-1.000)
 Metadata:
 IMAGE__INPUT_NAME=K:\blk18\oakgrove_sw.tif
 IMAGE__INPUT_FILE_SIZE=155199578.00
 GEOTIFF_NUM__1024__GTModelTypeGeoKey=1
 GEOTIFF_CHAR__GTModelTypeGeoKey=ModelTypeProjected
 GEOTIFF_NUM__1025__GTRasterTypeGeoKey=1
 GEOTIFF_CHAR__GTRasterTypeGeoKey=RasterPixelIsArea
 GEOTIFF_NUM__1026__GTCitationGeoKey=IMAGINE GeoTIFF Support
 Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
 @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
 Projection = Oblique Mercator (Hotine)|IMAGINE GeoTIFF Support
 Copyright 1991 - 2001 by ERDAS, Inc. All Rights Reserved
 @(#)$RCSfile: egtf.c $ $Revision: 1.7 $ $Date: 2001/09/27 14:59:29EDT $
 Projection Name = Oblique Mercator (Hotine)
 Units = meters
 GeoTIFF Units = meters|
 GEOTIFF_NUM__2048__GeographicTypeGeoKey=4269
 GEOTIFF_CHAR__GeographicTypeGeoKey=GCS_NAD83
 GEOTIFF_NUM__2060__GeogAzimuthUnitsGeoKey=9102
 GEOTIFF_CHAR__GeogAzimuthUnitsGeoKey=Angular_Degree
 GEOTIFF_NUM__3072__ProjectedCSTypeGeoKey=32767

Re: [GRASS-user] Import/conversion problem

2011-02-11 Thread Adam Dershowitz, Ph.D., P.E.


On Feb 11, 2011, at 12:14 PM, Stuart Edwards wrote:

 I'm not familiar with the Kyngesburye plugin and haven't used gdalwarp, but 
 here:
 
 I want to import it into a UTM zone 17 project.  So I did the following:
 gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' input.sid output_utm.sid
 
 it looks like you are just trying to create a new .sid file in zone 17 
 (output_utm.sid).  From the meta file at the MI source, I think the file is 
 already projected in utm - probably in zone 17, and with units of 'meters'.  
 So what you maybe intended was to just create a .tiffg from the .sid so that 
 it can be imported into GRASS.
 
 In mrsiddecode (the app that does all the work inside the plugin - I assume) 
 I would just issue the command
 
 ./mrsiddecode -i Hancock.sid -o Hancock_south.tif -of tifg -ulxy 0 0 -lrxy 
 71145 29160  
 
 where
 
 -i - input
 -o - output
 -of - output file type
 ulxy - upper left x,y
 lrxy - lower right x,y
 
 and you get a nice geotiff that r.in.gdal will recognize - already in utm 
 zone 17 most likely.  Actually, in my case, the OH mrsids are projected in 
 state plane coordinates but you get the picture.
 
 To get the mrsiddecode app you must register at 
 
 http://developer.lizardtech.com/ 
 
 so you can access to the Mac version of the decoder and mrsidinfo download 
 page.  And be slightly comfortable on the command line.
 
 Stu
 
 

Nope, that's not doing it.  I downloaded mrsiddecode and ran it.  It nicely 
generates a geotiff.  But, if I try to import that I still get an error because 
the project is UTM, while the image is Oblique Mercator with omerc projection.  
I tried to use gdalwarp to go from the geotiff to utm, but I get an error:

 gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84'  oak_grove_sw.tifg 
oak_grove_sw_utm.tifg
ERROR 1: latitude or longitude exceeded limits
ERROR 1: Too many points (441 out of 441) failed to transform,
unable to compute output bounds.

If I run gdalinfo on the geotiff I get it looks to me like the projection has 
lat long near 0.  So, I don't think that the problem is a MrSID problem.  But 
instead there is just something wrong with how I am doing the projection, or 
something is wrong with the file itself.

Here is the output of gdalinfo oak_grove_sw.tifg:


Driver: GTiff/GeoTIFF
Files: oak_grove_sw.tifg
Size is 6415, 8061
Coordinate System is:
PROJCS[Projection = Oblique Mercator (Hotine),
GEOGCS[NAD83,
DATUM[North_American_Datum_1983,
SPHEROID[GRS 1980,6378137,298.2572221010002,
AUTHORITY[EPSG,7019]],
AUTHORITY[EPSG,6269]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4269]],
PROJECTION[Hotine_Oblique_Mercator],
PARAMETER[latitude_of_center,0.9996],
PARAMETER[longitude_of_center,0.9996],
PARAMETER[azimuth,0.9996],
PARAMETER[rectified_grid_angle,90],
PARAMETER[scale_factor,0.9996],
PARAMETER[false_easting,0.9996],
PARAMETER[false_northing,0.9996],
UNIT[metre,1,
AUTHORITY[EPSG,9001]]]
Origin = (663144.500,240035.500)
Pixel Size = (1.000,-1.000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  663144.500,  240035.500) (  6d57'27.03E,  3d 9'14.09N)
Lower Left  (  663144.500,  231974.500) (  6d57'25.53E,  3d 4'52.96N)
Upper Right (  669559.500,  240035.500) (  7d 0'53.76E,  3d 9'12.88N)
Lower Right (  669559.500,  231974.500) (  7d 0'52.24E,  3d 4'51.77N)
Center  (  666352.000,  236005.000) (  6d59'9.64E,  3d 7'2.93N)
Band 1 Block=6415x1 Type=Byte, ColorInterp=Red
Band 2 Block=6415x1 Type=Byte, ColorInterp=Green
Band 3 Block=6415x1 Type=Byte, ColorInterp=Blue

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


[GRASS-user] Re: Import/conversion problem

2011-02-11 Thread Adam Dershowitz, Ph.D., P.E.


On Feb 11, 2011, at 9:23 AM, Adam Dershowitz, Ph.D., P.E. wrote:

 I am trying to import some data in GRASS and have run into a problem.  I hope 
 someone can give me a little insight to help out.
 I downloaded some aerial imagery from here:
 http://www.michigan.gov/dnr/0,1607,7-153-10371_14546-30211--,00.html
 
 I want to import it into a UTM zone 17 project.  So I did the following:
 gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' input.sid output_utm.sid
 


I googled around some and it looks like this is actually an issue with the 
Michigan projection in Proj4.  

I found this link:
http://www.osgeo.org/pipermail/mapserver-users/2006-July/018292.html

And this seems to give reasonable results, based on the above:

gdalwarp -t_srs '+proj=utm +zone=17 +datum=WGS84' -s_srs '+proj=omerc 
+lat_0=45.30917 +lonc=-86.0 +alpha=337.25556 +k=0.9996 +x_0=499839.8337 
+y_0=528600.2398 +ellps=GRS80 +datum=NAD83 +units=m' oakgrove_sw.sid 
oakgrove_sw_utm.tifg


Then it imports into grass fine.  So, it seems like something is broken with 
that projection.

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


Re: [GRASS-user] Using Access .mdb Files

2011-01-11 Thread Adam Dershowitz, Ph.D., P.E.
The .mdb file is a proprietary Microsoft Access format.

Here is some info about importing:
http://grass.osgeo.org/wiki/Data_formats#MicroSoft_Access

One option, mentioned there, is to convert it to sqlite then import.  

These might help:
http://code.google.com/p/mdb-sqlite/
http://www.sqlite.org/cvstrac/wiki?p=ConverterTools


--Adam



On Jan 11, 2011, at 12:01 PM, Rich Shepard wrote:

  This is a new one for me. The BLM (Bureau of Land Management, one of two
 agencies that manage federal lands in the US) has land status data I'd like
 to incorporate into a project. The data come in a .mdb file. This landowner
 file has vector data.
 
  I don't see an obvious v.in.whatever appropriate for .mdb files. What
 should I use for this?
 
 Thanks,
 
 Rich
 
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

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


[GRASS-user] No elevation in dxf polylines

2010-12-14 Thread Adam Dershowitz, Ph.D., P.E.
A while back I received a dxf file that contained contour elevation lines.  The 
problem is that when I imported it, the polylines all showed up at elevation 0, 
instead of at their correct elevation.
At the time, I had several discussions about this, but never figured out a 
solution.  Then, a year and a half ago, I saw a similar problem crop up on this 
list, along with a final outcome that it had been fixed, but no other details 
about that.
I just received a new elevation contour dxf file, from a different source, and 
sure enough, I am having the same problem with it.  It seems to import fine, 
but the polylines all show as elevation 0.  
I tried to import both with v.in.dxf and with v.in.ogr.  In the second case, I 
also tried -z.  
I am on a Mac using Kyngesburye's GRASS-6.4.0-3-Snow.

Any suggestions would be greatly appreciated.  

Thanks,

--Adam



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


Re: [GRASS-user] No elevation in dxf polylines

2010-12-14 Thread Adam Dershowitz, Ph.D., P.E.
I hunted around some more.  
It looks like that was fixed by hcho in changeset 36804, 20 months ago.  
So, either it wasn't actually fixed correctly, or that change was not 
incorporated into the binary that I have?  Is there a way to determine that 
easily?
If it was not included, I would greatly appreciate it if, it could be added in. 
 I am hoping not to have to download and build everything, just to get this one 
fix.

Thanks,

--Adam



On Dec 14, 2010, at 5:48 AM, Adam Dershowitz, Ph.D., P.E. wrote:

 A while back I received a dxf file that contained contour elevation lines.  
 The problem is that when I imported it, the polylines all showed up at 
 elevation 0, instead of at their correct elevation.
 At the time, I had several discussions about this, but never figured out a 
 solution.  Then, a year and a half ago, I saw a similar problem crop up on 
 this list, along with a final outcome that it had been fixed, but no other 
 details about that.
 I just received a new elevation contour dxf file, from a different source, 
 and sure enough, I am having the same problem with it.  It seems to import 
 fine, but the polylines all show as elevation 0.  
 I tried to import both with v.in.dxf and with v.in.ogr.  In the second case, 
 I also tried -z.  
 I am on a Mac using Kyngesburye's GRASS-6.4.0-3-Snow.
 
 Any suggestions would be greatly appreciated.  
 
 Thanks,
 
 --Adam
 
 
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

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


[GRASS-user] Display 3-D volume

2010-11-26 Thread Adam Dershowitz, Ph.D., P.E.
I would like to calculate and draw a 3-D volume, but I am not really sure if 
nviz can do it, or how to accomplish it.  
In this case I have two surfaces that are both in space over a boundary.  In 
other words, there is a boundary on the ground and then there are two 
surfaces in space above them.  These surfaces are not parallel to each other.  
The surfaces are defined using vector points.  
I am able to use v.to.rast to convert these surfaces to rasters and 
r.surf.nnbathy to fill in the two surfaces.  
I can then use mapcalc to find the local elevation difference between the two 
surfaces.  But that doesn't really solve my problem.  I want to be able to draw 
a 3-D image of this volume of space, where the top of the volume is the one of 
the initial surfaces, and the bottom is the other.  Then the horizontal extent 
should be the ground boundary.
If the above is not clear, then a simplified example would be to imagine 
drawing the airspace above someone's square property that goes from 1000 ft to 
1500 ft.  The result would be a cube floating in space above the property.  In 
my case the shapes are more complicated, but the idea is the same.
Is there any way I can use grass to display this shape?  
It seems that nviz would need to have the shape as a vector shape, but I don't 
really see how I can calculate out this shape.
If anyone has any thought or ideas I would greatly appreciate hearing them.

Thanks,


--Adam



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


Re: [GRASS-user] r.out.pov scale question

2010-11-03 Thread Adam Dershowitz, Ph.D., P.E.
Thanks.  This is helpful for some ideas.  
Although, it uses a vertical scale that is just a constant of 65535.  But, my 
followup email probably crossed with yours.  



--Adam



On Nov 3, 2010, at 4:22 AM, Markus Neteler wrote:

 Adam,
 
 find attached my (old) r.out.povscript script which does the needed
 calculations. Perhaps
 giving some ideas. the Povray scales are a bit tricky.
 
 cheers
 Markus
 
 On Wed, Oct 27, 2010 at 6:07 PM, Adam Dershowitz, Ph.D., P.E.
 adershow...@exponent.com wrote:
 I have been trying to use r.out.pov but something is not clear to me from 
 the documentation, and examples I can find on the web.
 If I use hftype=0 (the default) then, as I understand it it, each step, from 
 0-65535 represents one map unit (meters in my case).  That is giving me too 
 much stair-stepping in POVRAY.
 I think that part of the issue is that there is too much rounding of 
 elevations.  So, I decided to try hrtype=1.  As I understand it that will 
 scale the height of the image to use more of the range (my map just goes 
 from 61-1086 meters).  But, I can't seem to figure out how much it scales 
 by.  There is also the scale= option in r.out.pov, but I am not sure if that 
 is a multiplier or a divider?
 This is important because I need to then scale the heighfield in my POV 
 file.  If I use hrtype=0 then this is correct:
 scale  dx, 65535, dy 
 
 But, if I use hftype=1, what is the correct value for the above scale 
 command?  Is it 65535/1086 (max height in the map?)
 65535/(1086-61)  (vertical range of my map?)
 
 If I use scale=10 then should it be?
 scale  dx, 65535/10, dy 
 scale  dx, 65535*10, dy 
 scale  dx, 10, dy 
 
 Or should I use scale=0.1?  Or should I use r.out.pov scale=65535/1086
 
 Thanks,
 
 --Adam
 
 
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
 
 r.out.povscript

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


Re: [GRASS-user] r.out.pov scale question

2010-11-02 Thread Adam Dershowitz, Ph.D., P.E.
I have not heard anything back on this, so decided to go to the source code of 
r.out.pov.  I figured out the answer and wanted to post it, in case it is 
useful to anyone else, or someone might want to add it to the help page.
Here is what I figured out.  
1)  scale, and hftype are independent.  
So, first each cell is multiplied by scale (so, if a cell elevation is 12m and 
scale is 10, then the new value is 120.)  The default value of scale is 1.0.  
If hftype is set to 1, then each cell is multiplied by 65535/(maximum elevation 
value in the map).  

So, when using hftype=1, the correct scaling in the POV ray file is the maximum 
height in the map.  For example, if the maximum elevation is 1086 m, then this 
should go in the POV file:
scale  1391, 1086, 1810  // dx,dz,dy of extent in meters

Finally, I believe that there is a bug in r.out.pov!  It seems that bias is 
read in, in order to apply a bias to the height field, however hfBias is the 
variable that is actually being used for the calculations, and it is never 
assigned a value.  And bias is not actually used in any calculations.

--Adam



On Oct 27, 2010, at 9:07 AM, Adam Dershowitz, Ph.D., P.E. wrote:

 I have been trying to use r.out.pov but something is not clear to me from the 
 documentation, and examples I can find on the web.
 If I use hftype=0 (the default) then, as I understand it it, each step, from 
 0-65535 represents one map unit (meters in my case).  That is giving me too 
 much stair-stepping in POVRAY.  
 I think that part of the issue is that there is too much rounding of 
 elevations.  So, I decided to try hrtype=1.  As I understand it that will 
 scale the height of the image to use more of the range (my map just goes from 
 61-1086 meters).  But, I can't seem to figure out how much it scales by.  
 There is also the scale= option in r.out.pov, but I am not sure if that is a 
 multiplier or a divider?  
 This is important because I need to then scale the heighfield in my POV file. 
  If I use hrtype=0 then this is correct:
 scale  dx, 65535, dy 
 
 But, if I use hftype=1, what is the correct value for the above scale 
 command?  Is it 65535/1086 (max height in the map?)
 65535/(1086-61)  (vertical range of my map?)
 
 If I use scale=10 then should it be?
 scale  dx, 65535/10, dy 
 scale  dx, 65535*10, dy 
 scale  dx, 10, dy 
 
 Or should I use scale=0.1?  Or should I use r.out.pov scale=65535/1086
 
 Thanks,
 
 --Adam
 
 
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] Database question

2010-10-25 Thread Adam Dershowitz, Ph.D., P.E.
Thanks.  That is just what I needed!
(There was still a little trick that the first time I used it I used the whole 
path to the old db, instead of just sqlite.db.  The path failed, while just the 
file name worked)



--Adam



On Oct 25, 2010, at 11:30 AM, Achim Kisseler wrote:

 Hi,
 
 try v.db.reconnect.all or v.db.connect for single vector layers.
 
 Achim
 
 Am 25.10.2010 18:54, schrieb Adam Dershowitz, Ph.D., P.E.:
 This seems like it must be really easy and I am just missing something
 I have a project but I accidentally created the sqlite database file in the 
 wrong location.
 So, all of my project files are in one directory, but, in my home directory 
 I have a file sqlite.db.
 
 I just moving that file to where I want it.  Then I did:
 db.connect driver=sqlite database=/NewLocation/test.db
 
 Now if I do db.connect -p I see the correct path, but if I try to access a 
 vector that uses that database I get an error No such table.
 If I move the file back to the old location then the error goes away, even 
 if I don't use db.connect to point to the other location.  So, I am just 
 missing something about how to have grass know the correct location of a 
 database.
 If I just move the file, how can I get the vector map to know the correct 
 file to use, since db.connect is not doing the job?
 
 Thanks.
 
 --Adam
 
 
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] Import question

2010-10-01 Thread Adam Dershowitz, Ph.D., P.E.


On Oct 1, 2010, at 4:06 AM, Micha Silver wrote:

 On 10/01/2010 01:35 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 I have a series of points in an ascii files that represent points along a 
 line.  I would like to import them as a line, or import and convert to a 
 line.
 I see that 6.5 has v.in.lines, but I am using 6.4.  Is there any other way 
 to do that conversion?
 
 The data is 3D x,y,z points.  I can just import them using v.in.ascii, but 
 then they are points, with no lines.  Is there another way to either import, 
 directly, or convert?
 
   
 If it's only one line, then the simplest might be to re-write the ASCII file 
 formated in the GRASS standard format, as a line. You'll need to add the 
 header lines, something like:
 VERTI:
 L n 1
 X_coord Y_coord
 ...
 ...
 1 1
 
 Where 'n' is the number of points.
 
 Then run v.in.ascii ... format=standard and it should result in a line vector.



Thanks.  It is actually one line, at the moment, so I did that, and it worked 
fine.  But I will have others.  so was hoping for a generic solution.  I wrote 
a shell script that transforms my particular data into standard and it seems 
to be working fine.

Again, thanks for the response.

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


Re: [GRASS-user] Import question

2010-10-01 Thread Adam Dershowitz, Ph.D., P.E.


On Oct 1, 2010, at 4:18 PM, Hamish wrote:

 Adam wrote:
 I see that 6.5 has v.in.lines, but I am using 6.4.
 
 since it seems to be open season on backporting stuff, if there
 is widespread demand, and no objections, I'd consider backporting
 it for 6.4.1. but really it is just a wrapper script around
 v.in.mapgen. the most valuable thing about it is the easy to
 understand module name.
 
 
 

Thanks.  Once I heard that it is just a script, I downloaded it myself.  So, 
don't backport it on my account.  But, I do appreciate the thought.

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


[GRASS-user] Import question

2010-09-30 Thread Adam Dershowitz, Ph.D., P.E.
I have a series of points in an ascii files that represent points along a line. 
 I would like to import them as a line, or import and convert to a line.
I see that 6.5 has v.in.lines, but I am using 6.4.  Is there any other way to 
do that conversion?

The data is 3D x,y,z points.  I can just import them using v.in.ascii, but then 
they are points, with no lines.  Is there another way to either import, 
directly, or convert?

Thanks,

--Adam



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


[GRASS-user] Import question

2010-09-20 Thread Adam Dershowitz, Ph.D., P.E.
I have a large ortho image, that is in MrSID format  (A full county at high 
res).  The file is ~3.5 gig.  It covers a much larger area then I need.  So I 
set my region to the size that I do need, and then imported.  The import took 
something like 10 hrs.  And, I now see that in my PERMANENT folder I have 3 
files that are each 15 gig (one red, one blue, one green),  
The map was imported, but if I zoom to the size of the current map, it seems 
that the whole map was imported, not just the area inside the current region.
  
I thought that imports are cropped to the current region?  Am I mistaken about 
this?  Is there some setting to cause this to happen?  

I did the import with r.in.gdal.  I am using the binary release of 6.4 on a 
Mac.  
The reasons that I care are 1)  This map, for a small area of interest, it 
taking up 45 gig on my hard drive.  2)  Because the map is so large, it takes a 
while for the display to update when I make any changes.  

Any guidance?

Thanks,

--Adam



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


[GRASS-user] Planet coordinate systems?

2010-08-25 Thread Adam Dershowitz, Ph.D., P.E.
I am interested if anyone has used GRASS with data from Mars, or any other 
non-earth based system?  I don't see any epsg codes that would apply.  
So, I am looking for some general ideas and guidance to get going.  
If anyone has used GRASS this way, please let me know about your experience, 
useful links, or other things that might be helpful to deal with some of the 
existing planetary data, and how to use it.

Thanks,


--Adam



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


Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
Thanks.  I ended up just selecting each point, then typing them into the GCP 
dialog.  Very annoying, but it did the job.

--Adam



On Dec 1, 2009, at 8:01 PM, Richard Chirgwin wrote:

 Adam,
 
 If all else fails, work with a command line process ... I've never had happy 
 experiences with the purely GUI rectification.
 
 i.group (groupname) (mapname)
 i.target (groupname) Target_Location Target_Mapset
 d.mon X0
 i.points (groupname) - this launches the GCP capture GUI (old style, 
 X-windows but it works!)
 i.rectify (groupname) extension=something order=(polynomial order)
 
 RC
 --
 
 Message: 1
 Date: Mon, 30 Nov 2009 14:38:04 -0700
 From: Michael Barton michael.bar...@asu.edu
 Subject: Re: [GRASS-user] Georectify problem
 To: grass-user@lists.osgeo.org grass-user@lists.osgeo.org
 Message-ID: 6c956e66-153c-4152-809e-b4c28ab74...@asu.edu
 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
 
 Given the platform you are on and the fact that you are using an up-to- date 
 build of GRASS 6.4, I recommend you do this with the new wxPython  GUI 
 instead of the TclTk one. I think it will work better for you.
 
 Michael
 
 On Nov 30, 2009, at 2:16 PM, grass-user-requ...@lists.osgeo.org wrote:
 
  
 Date: Mon, 30 Nov 2009 09:57:42 -0800
 From: Adam Dershowitz adershow...@exponent.com
 Subject: [GRASS-user] Georectify problem
 To: GRASS user list grass-user@lists.osgeo.org
 Message-ID: 684bacb4-ceaf-4cdd-98d1-9f3ee5742...@exponent.com
 Content-Type: text/plain; charset=us-ascii
 
 I am trying to georectify an xy image.  I think that I am doing  things 
 correctly yet I keep getting an error.  Perhaps someone can  clear things 
 up for me.
 I imported the image into an XY location.  I then went to the  location 
 that I want to import into and brought up a map so I could  click on points.
 If then select file- georectify.  I fill in the info and then click  Start 
 georectifying.  It brings up the manage ground control points  window and a 
 display showing the xy map to be georectified.  If I  click there I can add 
 the GCP xy coords.  But if I then click in my  original window to select 
 the georgraphic coords I get an error:  can't read b1 coords : no such 
 variable.
 
 can't read b1coords: no such variable
 can't read b1coords: no such variable
   while executing
 $geoentry insert 0 $b1coords
   invoked from within
 if { [info exists geoentry] } {
   $geoentry insert 0 $b1coords
   }
   (command bound to event)
 
 I can't figure out why it will not let me select the points.  I have  
 selected the arrow tool in the map display.
 
 I am using a Mac with William Kyngesburye's binary builds.  I have  6.4 
 RC5-3 Snow with OS 10.6.2
 
 Thanks,
 
 --Adam

 
 
 
 --
 
 Message: 2
 Date: Mon, 30 Nov 2009 14:40:45 -0700
 From: Michael Barton michael.bar...@asu.edu
 Subject: Re: [GRASS-user] Trouble setting location and projection
 To: grass-user@lists.osgeo.org grass-user@lists.osgeo.org
 Message-ID: 01b9bf6f-b613-45fa-8520-38ec61489...@asu.edu
 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
 
 
 
 On Nov 30, 2009, at 2:16 PM, grass-user-requ...@lists.osgeo.org wrote:
 
  
 Date: Mon, 30 Nov 2009 13:03:16 -0600
 From: Ross Benisch benisc...@hotmail.com
 Subject: [GRASS-user] Trouble setting location and projection
 To: grass-user@lists.osgeo.org
 Message-ID: col121-w561c882825f5984eb916e8b6...@phx.gbl
 Content-Type: text/plain; charset=iso-8859-1
 
 
 I am trying to set the project location and cordinate system using  the 
 6.4.0svn version for windows but I keep getting the projection  error,
 
 'g.proj.exe-p' when I try and start Grass.  I have a GIS background  and I 
 am frustrated that I can't get it to work. I want to use the  projection 
 nad83UTM Zone 14N.  I have read through all of the  tuturiols and help 
 sheets and looked at the FAQs with no such luck.   I really want to use 
 this program to help with my job so if you  would help me get started I 
 would greatly appreciate it.
 
 
 
 Sincerely,
 
 Ross Benisch

 
 Can you give us some more specific information? Are you using the  location 
 wizard? Is this the newest windows binary? Which version of  Windows are you 
 using? What exactly is the error message that you get?
 
 Michael
 
 
 --
 
 Message: 3
 Date: Tue, 01 Dec 2009 01:37:43 +0100
 From: Helmut Kudrnovsky hel...@web.de
 Subject: [GRASS-user] Trouble setting location and projection
 To: grass-user@lists.osgeo.org
 Message-ID:
  5304763.17158.1259627864390.javamail.fm...@fmcert01.dlan.cinetic.de
 Content-Type: text/plain; charset=iso-8859-15
 
 
  
 I am trying to set the project location and cordinate system using the 
 6.4.0svn version for windows but I keep getting the projection error, 
 'g.proj.exe-p' when I try and start Grass.  I have a GIS background and I 
 am frustrated that 

Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
I did try it, but I can't currently get it to run.  My guess is that it is an 
issue of the current built of GRASS that I am using (6.4 RC5-3 on a 64 bit 
machine):

g.gui wxpython
Traceback (most recent call last):
  File /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/wxgui.py, line 
55, in module
import gui_modules.globalvar as globalvar
  File 
/Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/gui_modules/globalvar.py,
 line 59, in module
import wx
  File /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/__init__.py, 
line 45, in module
from wx._core import *
  File /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core.py, 
line 4, in module
import _core_
ImportError: 
dlopen(/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so, 2): 
no suitable image found.  Did find:
/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so: 
mach-o, but wrong architecture



--Adam



On Dec 2, 2009, at 6:47 AM, Michael Barton wrote:

 Important to note that this will not work with Windows, since Windows doesn't 
 run x11 unless you the Cygwin unix emulator.
 
 Have you tried georectification with the new wxPython GUI?
 
 Michael
 
 
 On Dec 1, 2009, at 11:20 PM, grass-user-requ...@lists.osgeo.org wrote:
 
 Date: Wed, 02 Dec 2009 15:01:23 +1100
 From: Richard Chirgwin rchirg...@ozemail.com.au
 Subject: [GRASS-user] Re: Georectify problem
 To: grass-user@lists.osgeo.org
 Message-ID: 4b15e693.1010...@ozemail.com.au
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Adam,
 
 If all else fails, work with a command line process ... I've never had
 happy experiences with the purely GUI rectification.
 
 i.group (groupname) (mapname)
 i.target (groupname) Target_Location Target_Mapset
 d.mon X0
 i.points (groupname) - this launches the GCP capture GUI (old style,
 X-windows but it works!)
 i.rectify (groupname) extension=something order=(polynomial order)
 
 RC
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
Sorry, Mac 10.6.2 using William Kyngesburye's binary builds.

--Adam



On Dec 2, 2009, at 8:35 AM, Michael Barton wrote:

 What OS platform?
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:34 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 I did try it, but I can't currently get it to run.  My guess is that it is 
 an issue of the current built of GRASS that I am using (6.4 RC5-3 on a 64 
 bit machine):
 
 g.gui wxpython
 Traceback (most recent call last):
 File /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/wxgui.py, 
 line 55, in module
   import gui_modules.globalvar as globalvar
 File 
 /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/gui_modules/globalvar.py,
  line 59, in module
   import wx
 File /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/__init__.py, 
 line 45, in module
   from wx._core import *
 File /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core.py, 
 line 4, in module
   import _core_
 ImportError: 
 dlopen(/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so, 
 2): no suitable image found.  Did find:
  /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so: 
 mach-o, but wrong architecture
 
 
 
 --Adam
 
 
 
 On Dec 2, 2009, at 6:47 AM, Michael Barton wrote:
 
 Important to note that this will not work with Windows, since Windows 
 doesn't run x11 unless you the Cygwin unix emulator.
 
 Have you tried georectification with the new wxPython GUI?
 
 Michael
 
 
 On Dec 1, 2009, at 11:20 PM, grass-user-requ...@lists.osgeo.org wrote:
 
 Date: Wed, 02 Dec 2009 15:01:23 +1100
 From: Richard Chirgwin rchirg...@ozemail.com.au
 Subject: [GRASS-user] Re: Georectify problem
 To: grass-user@lists.osgeo.org
 Message-ID: 4b15e693.1010...@ozemail.com.au
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Adam,
 
 If all else fails, work with a command line process ... I've never had
 happy experiences with the purely GUI rectification.
 
 i.group (groupname) (mapname)
 i.target (groupname) Target_Location Target_Mapset
 d.mon X0
 i.points (groupname) - this launches the GCP capture GUI (old style,
 X-windows but it works!)
 i.rectify (groupname) extension=something order=(polynomial order)
 
 RC
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
 
 

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


Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
I do have python installed as I have a bunch of things installed with macports 
and some of them depend on it and so installed it as part of the builds.  So I 
can't really get rid of it.  But, as part of macports, I do have python_select, 
which is a small port that allows me to switch which python is active and I am 
currently using the Apple installed Python 2.6, not one of the Macport 
installed versions.  So I don't think that is the problem?
I am downloading one of your builds to test out right now.

Thanks,

--Adam



On Dec 2, 2009, at 8:53 AM, Michael Barton wrote:

 Did you install Python yourself? If so, you will need to get rid of it. I 
 know how to do so with 10.5, but am not sure of 10.6. William might be able 
 to offer guidance on this.
 
 If you did not install a separate Python, I'm not sure what the problem is. 
 But you can try one of my builds. They work with Snow Leopard on at least one 
 student machine I know of. I've posted very recent binaries for 6.4, 6.5, and 
 7.0.
 
 http://www.public.asu.edu/~cmbarton/files/grass_mac
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:44 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 Sorry, Mac 10.6.2 using William Kyngesburye's binary builds.
 
 --Adam
 
 
 
 On Dec 2, 2009, at 8:35 AM, Michael Barton wrote:
 
 What OS platform?
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:34 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 I did try it, but I can't currently get it to run.  My guess is that it is 
 an issue of the current built of GRASS that I am using (6.4 RC5-3 on a 64 
 bit machine):
 
 g.gui wxpython
 Traceback (most recent call last):
 File /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/wxgui.py, 
 line 55, in module
 import gui_modules.globalvar as globalvar
 File 
 /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/gui_modules/globalvar.py,
  line 59, in module
 import wx
 File 
 /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/__init__.py, 
 line 45, in module
 from wx._core import *
 File /Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core.py, 
 line 4, in module
 import _core_
 ImportError: 
 dlopen(/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so, 
 2): no suitable image found.  Did find:
/Applications/GRASS-6.4.app/Contents/MacOS/etc/python/wx/_core_.so: 
 mach-o, but wrong architecture
 
 
 
 --Adam
 
 
 
 On Dec 2, 2009, at 6:47 AM, Michael Barton wrote:
 
 Important to note that this will not work with Windows, since Windows 
 doesn't run x11 unless you the Cygwin unix emulator.
 
 Have you tried georectification with the new wxPython GUI?
 
 Michael
 
 
 On Dec 1, 2009, at 11:20 PM, grass-user-requ...@lists.osgeo.org wrote:
 
 Date: Wed, 02 Dec 2009 15:01:23 +1100
 From: Richard Chirgwin rchirg...@ozemail.com.au
 Subject: [GRASS-user] Re: Georectify problem
 To: grass-user@lists.osgeo.org
 Message-ID: 4b15e693.1010...@ozemail.com.au
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Adam,
 
 If all else fails, work with a command line process ... I've never had
 happy experiences with the purely GUI rectification.
 
 i.group (groupname) (mapname)
 i.target (groupname) Target_Location Target_Mapset
 d.mon X0
 i.points (groupname) - this launches the GCP capture GUI (old style,
 X-windows but it works!)
 i.rectify (groupname) extension=something order=(polynomial order)
 
 RC
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
 
 
 
 

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


Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
For each port that you install with macports it determines what other ports are 
necessary.  Macports project has taken the attitude that they always want to 
use their own version of code so that changes by Apple won't break other 
specific dependencies, which has happened to them a number of times.  That 
leads to most ports working well, but can lead to other problems, so their are 
some pluses and minus to this approach.  But, that is the current approach, and 
if I were to try to force uninstall any python stuff, it would break other 
ports.  Apple actually has 2.6.1 installed, while macports installs 2.6.4.  
That said, python_select just changes links and moves files around so that only 
one version of python is visible and the others are hidden, except to 
explicit paths.  And I have confirmed that from the command line using 
python_select does change which version gets used.
So, according to macports, I have python2.5 python2.6 and python26-apple 
installed right now, but only the apple version should be visible, so I doubt 
that this is causing the problem.

--Adam



On Dec 2, 2009, at 9:11 AM, Michael Barton wrote:

 If you have a second python and it is in your python path, you'll have 
 trouble. Do you know what the Macports python_select script does?
 
 You really don't need to install any extra Python because your Mac already 
 comes with Python 2.6, the most up-to-date of the 2.x series. It should not 
 be necessary to run anything downloaded from MacPorts as any Python app 
 should use the system Python unless it needs an earlier version. If MacPorts 
 is installing 2.3 or 2.4 this could be a pretty big headache since GRASS 
 requires at least 2.4 and possibly 2.5 or above to run its wxPython GUI 
 (we've tried not to break 2.4 compatibility but I haven't tested it). I've 
 heard of other people having trouble with conflicts from MacPorts. I uses to 
 use Fink but ran into some of the same issues. And by now I don't really need 
 it since many applications are now available on the Mac in a more native way. 
 You might try getting rid of the MacPorts Python and see if GRASS run--and if 
 MacPorts Python apps still run.
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 10:00 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 I do have python installed as I have a bunch of things installed with 
 macports and some of them depend on it and so installed it as part of the 
 builds.  So I can't really get rid of it.  But, as part of macports, I do 
 have python_select, which is a small port that allows me to switch which 
 python is active and I am currently using the Apple installed Python 2.6, 
 not one of the Macport installed versions.  So I don't think that is the 
 problem?
 I am downloading one of your builds to test out right now.
 
 Thanks,
 
 --Adam
 
 
 
 On Dec 2, 2009, at 8:53 AM, Michael Barton wrote:
 
 Did you install Python yourself? If so, you will need to get rid of it. I 
 know how to do so with 10.5, but am not sure of 10.6. William might be able 
 to offer guidance on this.
 
 If you did not install a separate Python, I'm not sure what the problem is. 
 But you can try one of my builds. They work with Snow Leopard on at least 
 one student machine I know of. I've posted very recent binaries for 6.4, 
 6.5, and 7.0.
 
 http://www.public.asu.edu/~cmbarton/files/grass_mac
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:44 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 Sorry, Mac 10.6.2 using William Kyngesburye's binary builds.
 
 --Adam
 
 
 
 On Dec 2, 2009, at 8:35 AM, Michael Barton wrote:
 
 What OS platform?
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:34 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 I did try it, but I can't currently get it to run.  My guess is that it 
 is an issue of the current built of GRASS that I am using (6.4 RC5-3 on 
 a 64 bit machine):
 
 g.gui wxpython
 Traceback (most recent call last):
 File /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/wxgui.py, 
 line 55, in module
 import gui_modules.globalvar as globalvar
 File 
 /Applications/GRASS-6.4.app/Contents/MacOS/etc/wxpython/gui_modules/globalvar.py,
  line 59

Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
I just tried your 6.4 build and I noticed two things.  1)  When I double click 
on it, I see this in the terminal:
Rebuilding Addon menu...
Python 2.5.4 found.

But, if I try to switch to the non-default gui, here is what I get:

  g.gui wxpython
Traceback (most recent call last):
  File 
/Applications/Grass/GRASS-6.4_Barton.app/Contents/MacOS/etc/wxpython/wxgui.py,
 line 55, in module
import gui_modules.globalvar as globalvar
  File 
/Applications/Grass/GRASS-6.4_Barton.app/Contents/MacOS/etc/wxpython/gui_modules/globalvar.py,
 line 62, in module
import wx
  File 
/Applications/Grass/GRASS-6.4_Barton.app/Contents/MacOS/etc/python/wx/__init__.py,
 line 45, in module
from wx._core import *
  File 
/Applications/Grass/GRASS-6.4_Barton.app/Contents/MacOS/etc/python/wx/_core.py,
 line 4, in module
import _core_
ImportError: 
dlopen(/Applications/Grass/GRASS-6.4_Barton.app/Contents/MacOS/etc/python/wx/_core_.so,
 2): no suitable image found.  Did find:

/Applications/Grass/GRASS-6.4_Barton.app/Contents/MacOS/etc/python/wx/_core_.so:
 no matching architecture in universal wrapper

While, when I run William Kyngesburye's build I see this in the terminal:
Rebuilding Addon menu...
Python 2.6.4 found.

But, at the command line, if I just do python, I end up with Apple version 
2.6.1.  I will also ask about this on the macports list, which is very active.

For what it is worth, I know that in the past, with 10.5, and Macports 
installed I was able to run the wxpython version, but I can't seem to get it to 
work now.  

--Adam



On Dec 2, 2009, at 9:11 AM, Michael Barton wrote:

 If you have a second python and it is in your python path, you'll have 
 trouble. Do you know what the Macports python_select script does?
 
 You really don't need to install any extra Python because your Mac already 
 comes with Python 2.6, the most up-to-date of the 2.x series. It should not 
 be necessary to run anything downloaded from MacPorts as any Python app 
 should use the system Python unless it needs an earlier version. If MacPorts 
 is installing 2.3 or 2.4 this could be a pretty big headache since GRASS 
 requires at least 2.4 and possibly 2.5 or above to run its wxPython GUI 
 (we've tried not to break 2.4 compatibility but I haven't tested it). I've 
 heard of other people having trouble with conflicts from MacPorts. I uses to 
 use Fink but ran into some of the same issues. And by now I don't really need 
 it since many applications are now available on the Mac in a more native way. 
 You might try getting rid of the MacPorts Python and see if GRASS run--and if 
 MacPorts Python apps still run.
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 10:00 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 I do have python installed as I have a bunch of things installed with 
 macports and some of them depend on it and so installed it as part of the 
 builds.  So I can't really get rid of it.  But, as part of macports, I do 
 have python_select, which is a small port that allows me to switch which 
 python is active and I am currently using the Apple installed Python 2.6, 
 not one of the Macport installed versions.  So I don't think that is the 
 problem?
 I am downloading one of your builds to test out right now.
 
 Thanks,
 
 --Adam
 
 
 
 On Dec 2, 2009, at 8:53 AM, Michael Barton wrote:
 
 Did you install Python yourself? If so, you will need to get rid of it. I 
 know how to do so with 10.5, but am not sure of 10.6. William might be able 
 to offer guidance on this.
 
 If you did not install a separate Python, I'm not sure what the problem is. 
 But you can try one of my builds. They work with Snow Leopard on at least 
 one student machine I know of. I've posted very recent binaries for 6.4, 
 6.5, and 7.0.
 
 http://www.public.asu.edu/~cmbarton/files/grass_mac
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:44 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 Sorry, Mac 10.6.2 using William Kyngesburye's binary builds.
 
 --Adam
 
 
 
 On Dec 2, 2009, at 8:35 AM, Michael Barton wrote:
 
 What OS platform?
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 9:34 AM, Adam Dershowitz, Ph.D

Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.
I didn't install wxPython and neither did macports.

Macports is all installed in /opt/local and my .profile just adds that to my 
PATH and LIBRARY_PATH.  

I find it very odd that your build and William's build are finding different 
versions of python (and neither is the apple one).

By the way, if I run either of them, and then at the command line I run python, 
I do see the expected one.  In other words, yours reports Python 2.5.4 found. 
but then if I type python it shows 2.6.1, (while Williams reports 2.6.4)

How are you searching for python?  Are you not just using the typical path from 
.profile?

--Adam



On Dec 2, 2009, at 9:34 AM, Michael Barton wrote:

 Did you install wxPython? Did Macports?
 
 I understand how MacPorts works in this regard. Fink does the same thing, 
 though you can opt not to install dependencies and can also install binaries 
 that might need the dependencies (i.e., only needed to compile). This is a 
 Linux-like package installer model. It is handy but can have problems playing 
 nicely with other unix software installed on your system outside of the 
 MacPorts (or Fink) package hierarchy. I know that both try to wall off their 
 stuff into separate areas, but sometimes it doesn't work.
 
 To try and overcome the complications of having more than one Python version 
 and more than one wxPython version, both William and I now include a wxPython 
 build in our GRASS binaries. However, I'm not sure what will happen in a 
 situation like yours. Hopefully my binary will work.
 
 You might need to search out and look at your various system configuration 
 files and see if any of them refer to the MacPorts Python. These normally 
 live in your home folder and the etc folder. They begin with a ., so are 
 invisible unless you run something like Invisibility Toggler.app, use Text 
 Wrangler's open hidden function, or use the command line utilties.
 
 Files to look for include .profile and .bashrc. There might be others too 
 depending on how MacPorts manages setting system configurations.
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 10:24 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 For each port that you install with macports it determines what other ports 
 are necessary.  Macports project has taken the attitude that they always 
 want to use their own version of code so that changes by Apple won't break 
 other specific dependencies, which has happened to them a number of times.  
 That leads to most ports working well, but can lead to other problems, so 
 their are some pluses and minus to this approach.  But, that is the current 
 approach, and if I were to try to force uninstall any python stuff, it would 
 break other ports.  Apple actually has 2.6.1 installed, while macports 
 installs 2.6.4.
 That said, python_select just changes links and moves files around so that 
 only one version of python is visible and the others are hidden, except to 
 explicit paths.  And I have confirmed that from the command line using 
 python_select does change which version gets used.
 So, according to macports, I have python2.5 python2.6 and python26-apple 
 installed right now, but only the apple version should be visible, so I 
 doubt that this is causing the problem.
 
 --Adam
 
 
 
 On Dec 2, 2009, at 9:11 AM, Michael Barton wrote:
 
 If you have a second python and it is in your python path, you'll have 
 trouble. Do you know what the Macports python_select script does?
 
 You really don't need to install any extra Python because your Mac already 
 comes with Python 2.6, the most up-to-date of the 2.x series. It should not 
 be necessary to run anything downloaded from MacPorts as any Python app 
 should use the system Python unless it needs an earlier version. If 
 MacPorts is installing 2.3 or 2.4 this could be a pretty big headache since 
 GRASS requires at least 2.4 and possibly 2.5 or above to run its wxPython 
 GUI (we've tried not to break 2.4 compatibility but I haven't tested it). 
 I've heard of other people having trouble with conflicts from MacPorts. I 
 uses to use Fink but ran into some of the same issues. And by now I don't 
 really need it since many applications are now available on the Mac in a 
 more native way. You might try getting rid of the MacPorts Python and see 
 if GRASS run--and if MacPorts Python apps still run.
 
 Michael
 
 C. Michael Barton
 Director, Center for Social Dynamics  Complexity
 Professor of Anthropology, School of Human Evolution  Social Change
 Arizona State University
 
 Phone: 480-965-6262
 Fax: 480-965-7671
 www: www.public.asu.edu/~cmbarton, http://csdc.asu.edu
 
 
 
 
 
 
 
 On Dec 2, 2009, at 10:00 AM, Adam Dershowitz, Ph.D., P.E. wrote

Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.


On Dec 2, 2009, at 10:20 AM, William Kyngesburye wrote:

 On Dec 2, 2009, at 11:43 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 While, when I run William Kyngesburye's build I see this in the terminal:
 Rebuilding Addon menu...
 Python 2.6.4 found.
 
 But, at the command line, if I just do python, I end up with Apple version 
 2.6.1.  I will also ask about this on the macports list, which is very 
 active.
 
 For what it is worth, I know that in the past, with 10.5, and Macports 
 installed I was able to run the wxpython version, but I can't seem to get it 
 to work now.  
 
 Where does MacPorts install its Python?  And is it a frameowrk build?  I know 
 it normally keeps everything isolated in its own folder, but maybe Python is 
 different, if it's a framework.

It does put it into /opt/local.  Yes, it is a framework build, but in the 
macports directories.  So it puts a few things into /opt/local/bin and 
opt/local/lib but most of it goes into 
/opt/local/Library/Frameworks/Python.framework

 
 The way I have the python detection setup in the OSX startup, the first 
 priority is always the same major.minor version it was built with, and for my 
 Snow build it's 2.6.  Then the priorities are:
 
 $GRASS_PYTHON setting
 in $PATH
 /Library/Frameworks/Python.framework
 System python
 
 So, if you have the system python in your PATH (running python from a 
 Terminal), somehow that is failing, and if MacPorts python is in 
 /Library/Frameworks, it finds that.
 
 What does this give you:
 
 type -p pythonw2.6

type -p pythonw2.6
/opt/local/bin/pythonw2.6

 
 and this:
 
 `type -p pythonw2.6` -V

`type -p pythonw2.6` -V
Python 2.6.4


 
 Then we get to the architectures.  Does MacPorts build universal by default 
 or just the default ssytem architecture?  Try:
 
 file /path/to/macports/python/bin/python

file /opt/local/bin/python2.6
/opt/local/bin/python2.6: Mach-O 64-bit executable x86_64

 
 If it's only x86_64 (default on Snow), then yes wxpython will fail, as that 
 is only possible 32bit.
 

So, yes this one is x84_64 only.  

But this one:

file /opt/local/bin/python
/opt/local/bin/python: Mach-O universal binary with 3 architectures
/opt/local/bin/python (for architecture x86_64):Mach-O 64-bit 
executable x86_64
/opt/local/bin/python (for architecture i386):  Mach-O executable i386
/opt/local/bin/python (for architecture ppc7400):   Mach-O executable ppc

is not.  

And I was able to determine that python_select is just a script.  What it does 
to select the apple version of python is just the following:

ln -sf python26-apple /opt/local/etc/select/python/current
ln -snf /usr/bin/python2.6 /opt/local/bin/python
ln -snf /usr/bin/pythonw2.6 /opt/local/bin/pythonw
ln -snf /usr/bin/python2.6-config /opt/local/bin/python-config
rm -f /opt/local/bin/idle
ln -snf /usr/bin/pydoc2.6 /opt/local/bin/pydoc
ln -snf /usr/bin/smtpd2.6.py /opt/local/bin/smtpd.py
rm -f /opt/local/share/man/man1/python.1
ln -snf /usr/share/man/man1/python2.6.1.gz /opt/local/share/man/man1/python.1.gz
rm -f /opt/local/Library/Frameworks/Python.framework/Versions/Current
rm -f /opt/local/Library/Frameworks/Python.framework/Headers
rm -f /opt/local/Library/Frameworks/Python.framework/Resources
rm -f /opt/local/Library/Frameworks/Python.framework/Python

So it looks to me like it should be creating the correct links.  So if I do 
this:
which python
/opt/local/bin/python
I do get the link in macports, but that is just a link to the apple version.  

I just noticed something however.  Are you actually searching for python or 
python2.6 as your first priority?  The reason that I am asking is that 
python does point to the apple version. But python2.6 points to the macports 
version.  I wonder if that is the problem?
Finally, you said that you actually start by trying $GRASS_PYTHON.  If, my my 
.profile,  I just point that to the system python should that fix this issue?

Thanks,

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


Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.


On Dec 2, 2009, at 10:20 AM, William Kyngesburye wrote:

 On Dec 2, 2009, at 11:43 AM, Adam Dershowitz, Ph.D., P.E. wrote:
 
 While, when I run William Kyngesburye's build I see this in the terminal:
 Rebuilding Addon menu...
 Python 2.6.4 found.
 
 But, at the command line, if I just do python, I end up with Apple version 
 2.6.1.  I will also ask about this on the macports list, which is very 
 active.
 
 For what it is worth, I know that in the past, with 10.5, and Macports 
 installed I was able to run the wxpython version, but I can't seem to get it 
 to work now.  
 
 Where does MacPorts install its Python?  And is it a frameowrk build?  I know 
 it normally keeps everything isolated in its own folder, but maybe Python is 
 different, if it's a framework.
 
 The way I have the python detection setup in the OSX startup, the first 
 priority is always the same major.minor version it was built with, and for my 
 Snow build it's 2.6.  Then the priorities are:
 
 $GRASS_PYTHON setting
 in $PATH
 /Library/Frameworks/Python.framework
 System python

Success!  
Just doing this in my .profile:
 export GRASS_PYTHON=/usr/bin/pythonw2.6

solved the problem.  So I think that the issue is that macports just makes 
links for python and pythonw while you were actually searching for 
pythonw2.6.

But, Micheal, this fix doesn't work for your build.  I think that reason is 
that your version of MacOS/grass.sh in 6.4 (I haven't checked any others) 
actually contains this:
pyver_want=2.5

While William's contains this:
pyver_want=2.6

So, your version is searching for, and finding, pythonw2.5, which is the 
macports only version.  If macports wasn't installed, then it would move on to 
the 2.6 version, since it can't find 2.5.  

Thanks for all the help from both of you
Although I have not yet tried to georectify with wxpython, which was the whole 
point of this exercise initially.

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


Re: [GRASS-user] Re: Georectify problem

2009-12-02 Thread Adam Dershowitz, Ph.D., P.E.


On Dec 2, 2009, at 6:47 AM, Michael Barton wrote:

 Important to note that this will not work with Windows, since Windows doesn't 
 run x11 unless you the Cygwin unix emulator.
 
 Have you tried georectification with the new wxPython GUI?

Again, thanks for the help.  After that problem with getting wxPython to work, 
yes the georectify seems to work in the wxPython gui version.


 
 Michael
 
 
 On Dec 1, 2009, at 11:20 PM, grass-user-requ...@lists.osgeo.org wrote:
 
 Date: Wed, 02 Dec 2009 15:01:23 +1100
 From: Richard Chirgwin rchirg...@ozemail.com.au
 Subject: [GRASS-user] Re: Georectify problem
 To: grass-user@lists.osgeo.org
 Message-ID: 4b15e693.1010...@ozemail.com.au
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 Adam,
 
 If all else fails, work with a command line process ... I've never had
 happy experiences with the purely GUI rectification.
 
 i.group (groupname) (mapname)
 i.target (groupname) Target_Location Target_Mapset
 d.mon X0
 i.points (groupname) - this launches the GCP capture GUI (old style,
 X-windows but it works!)
 i.rectify (groupname) extension=something order=(polynomial order)
 
 RC
 
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user

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


Re: [GRASS-user] Label crash

2009-04-17 Thread Adam Dershowitz, Ph.D., P.E.




On Apr 17, 2009, at 7:43 AM, Glynn Clements wrote:



Markus Neteler wrote:


If I generate a label:
v.label map=Labels column=stuff font=/usr/X11R6/lib/X11/fonts/TTF/ 
Vera.ttf
then it displays fine in the gui.  But if I try to use other  
monitors from

the command line I consistently get a crash.  For example:

d.mon start=PS
d.labels labels=Labels


I have tried with Spearfish, GRASS 6.4.0RC4, Linux 64bit:

v.label  map=roads colum=label font=/usr/share/fonts/TTF/Vera.ttf
d.mon start=PS
d.labels labels=roads
d.mon stop=PS
kghostview map.ps

No problem, looks fine.
It seems to be Mac specific.


And I get the following repeated a whole bunch of times:

The process has forked and you cannot use this CoreFoundation  
functionality

safely. You MUST exec().
Break on
__THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ 
()

to debug.

The same thing happens if I use d.mon start=PNG.


could fork() in
lib/driver/main.c
be the problem?


Yes. It's basically a symptom of MacOSX is sort of Unix, but not
quite.


Actually MacOSX is Unix and Linux is almost Unix.




A similar issue affects libW11 on Cygwin. There, mon.start runs the
driver in the background (spawnl(_P_DETACH, ...)) with argv[2] = -,
which prevents it from fork()ing.

Something similar could be done for MacOSX. However, this isn't
robust, as it relies upon mon.select retrying upon failure. If the
driver takes too long to start, mon.select will fail.



This explains the problem:  
http://developer.apple.com/technotes/tn2005/tn2083.html#SECDAEMONVSFRAMEWORKS

Although I am not sure about the solution.


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


Re: [GRASS-user] Multiple to one question

2009-04-16 Thread Adam Dershowitz, Ph.D., P.E.


On Apr 16, 2009, at 3:02 AM, Moritz Lennert wrote:


On 16/04/09 06:29, Adam Dershowitz, Ph.D., P.E. wrote:
I really liked the suggestion, so I tried itbut it doesn't  
work. To continue my simple example, I did  create view less2  
cat,Value

from data where Value  2; So I end up with a view, as expected. The
problem is that if I now link my map to that view, I get an error: No
attribute found for cat 1 (since the object still tries to link to  
1).  And, the same for 2 and 4.  And, I still see the points and

slashes (ie it still draws point a and puts a null value then a slash
then 1.1. So is there a way to have it not draw a symbol and not draw
null text when it can't find an attribute?  Since, the whole point
of what I am trying to do in this case is to eliminate certain data
with a query?


What do you mean by eliminate ?


Maybe you should be more precise about your objectives. Are you  
trying to display something on a map, or not ? If all your looking  
for is tables, than you don't need GRASS at all.


Hmmm, I guess I was not that clear.  Sorry, and thanks for your help  
and patients.


What I mean is that I have a map that has a bunch of sites on it, and  
values shown next to each site as a label.  In many cases there are  
multiple values shown.


What I want to do is draw a second map, where I only show sites where  
the value is greater then a certain threshold.  In other words, my  
first map has all values shown.  My second map should just show sites  
where value is, for example, greater than 2.0 (or whatever).


So what I ended up doing was copying my original map, and then linking  
my new map to a view of the original data.  But that didn't work  
because then all the sites that are below the threshold (and therefor  
are not in the view) don't have a correct value or cat, but the icons  
are still shown, and when there were multiple values in the original a  
slash is still drawn, since it seems that it is using a null value  
for the labels.







On 16/04/09 07:35, Adam Dershowitz, Ph.D., P.E. wrote:
 It seems like I should be able to edit the cats, and I tried a few

different things with v.edit, but I have not had any luck.  I tried
some things like this: v.edit map=foo tool=catdel -r where=cat   
0 but it gives me: ERROR: Tool catdel requires option cats  
Although the

above seems to work with tool=select, which I was using to test
things about before doing the delete.


As the message says, tool catdel does not work with a select, but  
you have to give it a list of cats. You can do that with something  
like this:


v.edit map=foo tool=catdel cats=`v.db.select -c foo col=cat  
where=XYZ | awk '{printf%i,,$1} END{print}'`

(note the back ticks)


I ended up doing something pretty similar to this last night, although  
I ended up using environmental variables to store the select results.   
And it accomplished half of what I need.  The problem is that all  
sites are still shown, even if they no no longer have any values, in  
the cases where the edit has eliminated all of them.  So if a vector  
point had a value of 1.0, it is still drawn.


If I follow the above with:
v.edit map=foo tool=delete -r where=cat  0 then it also eliminates  
the sites that no longer have any categories.  So I guess I have  
things working, but it feels like a kluge, and there should be a  
cleaner solution.






I copied my original vectors, and created the view.  Now what I want
to do is to delete all the categories in this vector that point to
null. Is there a way to do that?


Why do you want to do that ? If I understood you correctly, all of  
these cats have a meaning. Maybe not in the currently linked view,  
but in the original table. So if you delete these cats, you will  
lose the link to the values in the original table.


Again, I think we need a better explanation of what it is you are  
trying to get at.


Moritz



Here is a bigger picture explanation.

A bunch of samples were taken at different locations and different  
times.  I want to be able to generate a few different maps:

1)  Show all sampling locations (that one is easy and already done).
2)  Show all sample locations, and values, where value is  2.0, for  
example.  In other words, if the value at a location is below 2.0 then  
don't display the value, and if all the values at that location are  
below 2.0 don't even display the icon for the location.
Essentially what I am trying to do is to put a red dot where ever the  
I had a measurement above 2.0, and also list those values by the red  
dot.


So far I have not been able to get the above using views and linking  
to those views, because GRASS still knows about the points that are  
below 2.0 and tries to display them even if they are not in the view  
and treats them as null values, rather then as values to be ignored.


So far the solution that seems to work is:
1)  Create my master map showing all locations and values.
2)  Make a copy map that I

[GRASS-user] Multiple to one question

2009-04-15 Thread Adam Dershowitz, Ph.D., P.E.
This is somewhat a followup to my prior post and somewhat a new, but  
related problem.


I ended up doing what I had proposed, which is I have a table that has  
each sample value and location:


LocationValue cat
a   3.1 1
b   2.1 2
a   1.1 3
c   4.1 4

etc.

Then I have linked each vector point to multiple categories by using
v.edit map=foo layer=1 where=cat==1 type=point tool=catadd cat=3   
(for example)  So then I have an vector point that has a cat of both 1  
and 3.  So far so good.
If I then try to display Label vectors using Value for the attribute,  
it works fine.  Each value is displayed separated by a slash /.


The problem is if I try to use a SQL query, it is not working as  
expected.  I think that what it is doing is just applying the test to  
the first value, then showing or hiding the other values based on that  
first test (although I am not 100% sure that is what it is doing).
So, for example, if I were to do Use SQL query: Value  2.0 it would  
draw a label like this:  3.1/1.1  And if I were to use a query of  
Value  2.0 it would not display anything.  What I want it to do is to  
show all values that are actually greater than 2. and not to display  
the others.


Any suggestions of what it is doing, or what I can do about it?

I am using 6.4 RC3 on a Mac, and using sqlite for my db.
If I connect to the db just using the command line to connect to  
sqlite, then the query works as expected.


As a secondary question, is it possible to change the / separator  
that is used in the labels?  Where is that determined?  Can I instead  
make it /n and get each value below?


Thanks,

--Adam

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


Re: [GRASS-user] Multiple to one question

2009-04-15 Thread Adam Dershowitz, Ph.D., P.E.



--Adam



On Apr 15, 2009, at 9:29 PM, Adam Dershowitz, Ph.D., P.E. wrote:



On Apr 15, 2009, at 4:29 PM, Moritz Lennert wrote:


On 16/04/09 01:00, Adam Dershowitz, Ph.D., P.E. wrote:
This is somewhat a followup to my prior post and somewhat a new,  
but related problem.
I ended up doing what I had proposed, which is I have a table that  
has each sample value and location:

LocationValue cat
a3.11
b2.12
a1.13
c4.14
etc.
Then I have linked each vector point to multiple categories by using
v.edit map=foo layer=1 where=cat==1 type=point tool=catadd  
cat=3  (for example)  So then I have an vector point that has a  
cat of both 1 and 3.  So far so good.
If I then try to display Label vectors using Value for the  
attribute, it works fine.  Each value is displayed separated by a  
slash /.
The problem is if I try to use a SQL query, it is not working as  
expected.  I think that what it is doing is just applying the test  
to the first value, then showing or hiding the other values based  
on that first test (although I am not 100% sure that is what it is  
doing).
So, for example, if I were to do Use SQL query: Value  2.0 it  
would draw a label like this:  3.1/1.1  And if I were to use a  
query of Value  2.0 it would not display anything.  What I want  
it to do is to show all values that are actually greater than 2.  
and not to display the others.

Any suggestions of what it is doing, or what I can do about it?


Create a view in your database containing the results of your  
query, including cat values, and link your map to that view,  
instead of the table. If you want to change the content, just drop  
the view and recreate it with a different query. You can do all  
this either directly in sqlite, or via the db.execute GRASS module.


Moritz


I really liked the suggestion, so I tried itbut it doesn't work.
To continue my simple example, I did  create view less2 cat,Value  
from data where Value  2;

So I end up with a view, as expected.
The problem is that if I now link my map to that view, I get an  
error:  No attribute found for cat 1 (since the object still tries  
to link to 1).  And, the same for 2 and 4.  And, I still see the  
points and slashes (ie it still draws point a and puts a null value  
then a slash then 1.1.
So is there a way to have it not draw a symbol and not draw null  
text when it can't find an attribute?  Since, the whole point of  
what I am trying to do in this case is to eliminate certain data  
with a query?





It seems like I should be able to edit the cats, and I tried a few  
different things with v.edit, but I have not had any luck.  I tried  
some things like this:

v.edit map=foo tool=catdel -r where=cat  0
but it gives me:
ERROR: Tool catdel requires option cats
Although the above seems to work with tool=select, which I was using  
to test things about before doing the delete.


I copied my original vectors, and created the view.  Now what I want  
to do is to delete all the categories in this vector that point to  
null.  Is there a way to do that?


Thanks,

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


Re: [GRASS-user] Multiple to one question

2009-04-14 Thread Adam Dershowitz, Ph.D., P.E.


On Apr 14, 2009, at 9:51 AM, Vincent Bain wrote:

Hmmm, not sure you understood what I suggested (or maybe I did not  
catch

your point of view !). Let's consider you add two measures a week for
point A (cat=1), and 1 measure monthly for point B (cat=2), then after
one year you have :
* in table1 (cat integer):
2 recors (cat=1 and cat=2)

* in table2 (cat integer, mes float):
116 records (104 records with cat=1 and 12 records with cat=2).


Thank you.  I didn't understand before (I thought that you meant a  
column for each measurement date).  But this does explain it, and it  
makes a lot of sense.


--Adam



Where is there a problem for you ?
Hope this helps,

VB


Le mardi 14 avril 2009 à 09:38 -0700, Adam Dershowitz, Ph.D., P.E. a
écrit :

On Apr 14, 2009, at 4:06 AM, Moritz Lennert wrote:


On 14/04/09 08:37, Vincent Bain wrote:

Hello Adam,
maybe another solution in this case would be a set of 2 tables :
* one linking to the geometry, that is containing nothing but cat
values,
* another one, containing a cat column (related to the geometric
table) and different data columns corresponding to your sampling.


I think that if all you want is calculate some means or similar
across dates and then display the results, Vincent's solution is the
easiest.

But you could also use layers [1]:

layer 1 = January round of sampling
layer 2 = February round of sampling
etc.

You would have to give each point a category value in each layer (cf
v.category) and then either create separate tables for each period
linking each to one of the layers or at least create some obvious
cat values (i.e. 100s for January, 200s for February, etc) and link
on single table to all the layers, but with different cat values in
each layer.


Moritz

[1] See Vector object categories and attribute management on 
http://grass.osgeo.org/grass64/manuals/html64_user/vectorintro.html
for a quick introduction


Thanks,

But, the problem with both of these approaches, columns, and layers,
(Vincent or Moritz version) is that I don't have consistent times for
each site.  So, at site A I might have 5 samples, once a month and at
site B I have 2 samples, one each year, and site C I have a few  
spread

over a few years.
So both of those approaches essentially need to have a column, or
layer, for each possible time of sampling.  But that is not really
appropriate for the quasi-random times of the samples.






Does this help ?
VB
Le lundi 13 avril 2009 à 14:23 -0700, Adam Dershowitz a écrit :

I am trying to set up a new project in Grass, and I have a
question  about the best approach.
I have different vector locations, and at each one there were
multiple  samples taken.  At the moment I have each sample as a
row in a data  base.
My question is how best to put this data into a set of vector
points.
I believe that I can do it in either of two ways (of not others).
1)  I can create a vector point at each location, then I think
that I  can have multiple cats for that object.  So I think I can
do cat=1,3,6  for a given location.
Will that work OK?
2)  I can just create different vector objects, that happen to be
at  the identical location, and have each one point to a different
cat.

If the above is not clear, here is a bit more detailed example.
At location A there was a sample collected on 1/1 with a value of
2.1,  on 2/2 with a value of 2.2 and on 3/3 with a value of 3.3

The above data is already 3 rows in a database.

I want to be able to display data about point A (say, average
value or  things like that).  Should I just create a vector point
A and then do  cat=1,2,3 or should I create 3 different vector
points at A, each one  having a different cat?

Any guidance about the benefits or limitations each approach (or
any  other approach to consider) would be greatly appreciated.

Thanks,

--Adam



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


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









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


Re: [GRASS-user] face to DEM?

2009-02-20 Thread Adam Dershowitz, Ph.D., P.E.
Thanks.  I did, but didn't have any luck.  In one case I ended up  
making some pretty art, but it wasn't helpful.  The problem was that  
it included all the stuff outside of the face, as well as inside  
where it should have covered and I need.
And I just tried it again, with another simple shape and a different  
map, and this time, even though I first set the region to match the  
input map, I am still getting strip exists with insufficient data.   
ERROR2:  zero point in the given region!  Input failed.


--Adam



On Feb 20, 2009, at 2:12 AM, Jachym Cepicky wrote:


Hi,

you can try v.surf.rst as well

j

Vincent Bain píše v Ne 15. 02. 2009 v 10:32 +0100:

Hello Adam,
hope I understood what you mean to do. If I had to cope with your
problem, I would import the source file as points, then run  
v.to.rast,

and r.surf.nnbathy with the l interpolation method.
The risk for this solution is the triangulation performed by
r.surf.nnbathy be different from your source TIN...

Good luck,
Vincent.

Le samedi 14 février 2009 à 16:42 -0800, Adam Dershowitz a écrit :

I have some 3-d vector faces.  They were defined in a text file like
this:
F 10
1 2 1
2 2 2
...
...
etc.

I imported them into grass like this:
v.in.ascii -zn input=faces.txt out=faces format=standard
and all seems fine.

I can see the faces, and if I click on points around the edges I can
get a height as well.
I can't figure out how to generate a raster DEM from these faces.
Essentially I would like to know the approximate elevation at each
raster point inside the faces.
I tried v.to.rast but then I get Column parameter missing
For v.to.rast3 I get  Unable to get layer info for vector map
I also tried v.extrude but I see all 0s (ie Number of areas: 0 etc.)

Did I do something wrong on my import?  Did I miss some other way to
do the conversion?
I want to be able to do some mapcalcs with the heights of an these
faces compared to another raster map, but I can't figure out how to
convert these faces to something that I can work with.

Thanks much,

--Adam



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



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

--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/pgp/JachymCepicky.pgp

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


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


Re: [GRASS-user] Volumes of intersections

2009-01-27 Thread Adam Dershowitz, Ph.D., P.E.
I am still somewhat stuck on this.  I have defined a face (3-d area)  
and it seems that very few of the vector functions can do anything  
with a face like that.

Any other suggestions for doing these types of calculation?

Thanks,

--Adam



On Jan 2, 2009, at 5:14 PM, G. Allegri wrote:


I don't know the latest devlopments on the 3d vector system, but I
would convert the vector to rasters (2d or 3d) and then use map
algebra...

giovanni

2009/1/3 Adam Dershowitz adershow...@exponent.com:
Is it possible to use grass to calculate the volume of a part of a  
3-D

vector object?
What I mean is if I have a mountain, for example, that is defines  
in one
vector map.  Then, in another map, I define an area (a plane for  
example).

This represents a slice through the mountain.
Is it possible to calculate the volume of the mountain that lies  
above the
second plane?  (how much rock is above the slice through it?) It  
seems like

it should be doable, but I am not really sure how to get going.
Any suggestions?

Thanks,

--Adam



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



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


Re: [GRASS-user] r.in.wms issues

2009-01-27 Thread Adam Dershowitz, Ph.D., P.E.


On Jan 27, 2009, at 1:50 PM, Adam Dershowitz wrote:

I am trying to use r.in.wms to get elevation data from  
wms.jpl.nasa.gov, but I have been running into two different  
problems.  I have been using the gui on a mac with 6.3, although I  
also tried 6.4 RC2 and got similar results.  The files do download  
but then I can't seem to work with them properly.  I have tried  
geotiff and png.  I have tried a bunch of other combinations as well.



The first problem seems to be with how temporary files are being  
named so that patching is not working properly.  Here is the command  
that is being generated by the gui:


r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi  
layers=us_ned format=png wmsquery=version=1.1.1 maxcols=1024  
maxrows=1024 {wgetoptions=-c -t 5 -nv} {curloptions=-C - --retry 5 - 
s -S} method=cubic v=1


This is followed by this long list of errors:
Calculating tiles
Requesting 2 tiles.
Downloading tiles
Tile already downloaded
Tile already downloaded
All tiles downloaded successfully
Creating output file that is 972P x 558L.
Processing input file /Users/dersh/grass/wms_download/ 
elev_us_ned2__0.png.

Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map elev_us_ned2_tile_0_tmp.alpha
Parse error
Raster map elev_us_ned2_tile_0.1 not found
Invalid map elev_us_ned2_tile_0_tmp.alpha
Parse error
Raster map elev_us_ned2_tile_0.2 not found
Illegal filename. Character 
 not allowed.
Illegal filename. Character 
 not allowed.
Illegal filename. Character 
 not allowed.
Raster map elev_us_ned2_tile_0_tmp.1
elev_us_ned2_tile_0_tmp.2 not found
Illegal filename. Character 
 not allowed.
raster: couldn't be removed
Illegal filename. Character 
 not allowed.
header: couldn't be removed
Illegal filename. Character 
 not allowed.
category: couldn't be removed
Illegal filename. Character 
 not allowed.
color: couldn't be removed
Illegal filename. Character 
 not allowed.
history: couldn't be removed
Illegal filename. Character 
 not allowed.
misc: couldn't be removed
Illegal filename. Character 
 not allowed.
fcell: couldn't be removed
Illegal filename. Character 
 not allowed.
g3dcell: couldn't be removed
Illegal filename. Character 
 not allowed.
colr2/PERMANENT: couldn't be removed
elev_us_ned2_tile_0_tmp.1
elev_us_ned2_tile_0_tmp.2 nothing removed
Creating output file that is 971P x 560L.
Processing input file /Users/dersh/grass/wms_download/ 
elev_us_ned2__1.png.

Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map elev_us_ned2_tile_1_tmp.alpha
Parse error
Raster map elev_us_ned2_tile_1.1 not found
Invalid map elev_us_ned2_tile_1_tmp.alpha
Parse error
Raster map elev_us_ned2_tile_1.2 not found
Illegal filename. Character 
 not allowed.
Illegal filename. Character 
 not allowed.
Illegal filename. Character 
 not allowed.
Raster map elev_us_ned2_tile_1_tmp.1
elev_us_ned2_tile_1_tmp.2 not found
Illegal filename. Character 
 not allowed.
raster: couldn't be removed
Illegal filename. Character 
 not allowed.
header: couldn't be removed
Illegal filename. Character 
 not allowed.
category: couldn't be removed
Illegal filename. Character 
 not allowed.
color: couldn't be removed
Illegal filename. Character 
 not allowed.
history: couldn't be removed
Illegal filename. Character 
 not allowed.
misc: couldn't be removed
Illegal filename. Character 
 not allowed.
fcell: couldn't be removed
Illegal filename. Character 
 not allowed.
g3dcell: couldn't be removed
Illegal filename. Character 
 not allowed.
colr2/PERMANENT: couldn't be removed
elev_us_ned2_tile_1_tmp.1
elev_us_ned2_tile_1_tmp.2 nothing removed
Patching [.1] channel
r.patch - elev_us_ned2_tile_0.1 not found
r.patch - elev_us_ned2_tile_1.1 not found
One or more input maps not found
Raster map elev_us_ned2_tile_0.1 not found
elev_us_ned2_tile_0.1 nothing removed
Raster map elev_us_ned2_tile_1.1 not found
elev_us_ned2_tile_1.1 nothing removed
Patching [.2] channel
r.patch - elev_us_ned2_tile_0.2 not found
r.patch - elev_us_ned2_tile_1.2 not found
One or more input maps not found
Raster map elev_us_ned2_tile_0.2 not found
elev_us_ned2_tile_0.2 nothing removed
Raster map elev_us_ned2_tile_1.2 not found
elev_us_ned2_tile_1.2 nothing removed
Raster map elev_us_ned2 not found in current mapset
Raster map elev_us_ned2 not found in current mapset
Raster map elev_us_ned2 not found in current mapset
Raster map elev_us_ned2 not found in current mapset
Raster map elev_us_ned2 not found in current mapset
Raster map elev_us_ned2 not found in current mapset

The odd thing is that I am left with four temporary maps in the  
mapset:  elev_us_ned2_tile_0_tmp.1 elev_us_ned2_tile_0_tmp.2  
elev_us_ned2_tile_1_tmp.1 elev_us_ned2_tile_1_tmp.1  so it seems  
that the script can't find these maps for some reasons.


The second problem, that might or might not be related, is that if I  
open the temporary files, there is a slot between them.  

Re: [GRASS-user] r.in.wms issues

2009-01-27 Thread Adam Dershowitz, Ph.D., P.E.


On Jan 27, 2009, at 5:57 PM, Hamish wrote:


Adam Dershowitz wrote:

I am trying to use r.in.wms to get elevation data from
wms.jpl.nasa.gov, but I have been running into two different  
problems.
I have been using the gui on a mac with 6.3, although I also tried  
6.4

RC2 and got similar results.


which/who's Mac binaries?


Kyngesburye



what version of gdal tools? (gdalinfo --version from the command  
prompt)


GDAL 1.5.4, released 2009/01/07
(I have also tried out the 1.6 release, and it reports GDAL 1.6.0,  
released 2008/12/04.)







The files do download but then I can't seem to work with them
properly.  I have tried geotiff and png.  I have tried a bunch
of other combinations as well.



Here is the command that is being generated by the gui:

r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi \
  layers=us_ned format=png wmsquery=version=1.1.1 \
  maxcols=1024 maxrows=1024 {wgetoptions=-c -t 5 -nv} \
  {curloptions=-C - --retry 5 -s -S} method=cubic v=1


mapserver= usually starts with http://;. This appears to be  
optional for

wget; but I don't know about curl.


But the download seems to go fine.  Although in my early testing I had  
it set for a higher resolution so it was getting a bunch of downloads  
and sometimes the server would complain that it was too busy.  I only  
figured out that problem because in those cases the .geotiff files  
were much smaller.  When I checked they contained the error message.   
But r.in.wms tried to use them anyway





method=cubic is irrelevant if the location is WGS84 Lat/lon, you can  
omit it.


I am using UTM not Lat/Long.  And that is why it is trying to do the  
conversion, I think.






srs= is missing in above command?


By default it was filling in src=EPSG:4326, which I believe is fine  
for UTM nad83 in the US.  I tried it both with and without that with  
the same results.








This is followed by this long list of errors:



Invalid map elev_us_ned2_tile_0_tmp.alpha
Parse error


?
perhaps a Mac/BSD vs GNU command line util using a non-portable  
command?


On linux(debian/etch) I get the same result/errors as Markus.


Markus:

I tried in 6.4 and got (copying your command line):




I just tried that command again with 6.4RC2.  I also get the identical  
results to Markus.  (and adding style=feet_real make it reasonable  
units).  However there are the two files created.  If I try to view  
one of them there is still that crack across the middle, where it  
looks like one is rotated and the other is not.  And if I try to view  
the other one it is just all zeros.




6.4.0rcX or develbranch6?  Note in develbranch6 null values are  
broken:

trac #455, #392?   http://trac.osgeo.org/grass/ticket/455

!!

GR65 r.info -r elev_us_ned65.1
min=-2147483648
max=53

#fix
GR65 r.null elev_us_ned65.1 setnull=-2147483648


strange, for .2 min is given as -2147483648 but r.univar shows
zero null cells.




Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 -
done.
Rename raster elev_us_ned2_tile_0.1 to elev_us_ned2.1
Rename raster elev_us_ned2_tile_0.2 to elev_us_ned2.2


so far so good,


ERROR: Raster map elev_us_ned2 not found in current mapset
ERROR: Raster map elev_us_ned2 not found in current mapset
ERROR: Raster map elev_us_ned2 not found in current mapset
ERROR: Raster map elev_us_ned2 not found in current mapset
ERROR: Raster map elev_us_ned2 not found in current mapset
ERROR: Raster map elev_us_ned2 not found in current mapset

Slightly better/different but eventually failing, too. :(


fwiw, these ERROR: Raster map  not found in current mapset are
from the 6 r.support calls in the r.in.wms script just after:

eval r.in.gdalwarp $GDALWARP
if [ $? -ne 0 ] ; then
  exit 1
fi

(I am not sure if that $? check really works: is it testing that eval
could run the command, not if the command exited successfully?)


the problem here is that the output is called map.1 and map.2 so  
the

raster map name passed to r.support are wrong.  map.2 is apparently
alpha layer (empty map), while map.1 contains the data.


in a lat/lon WGS84 location:

grass640 g.region n=46:04N s=39:30N w=80:24W e=71:20W res=0:00:30

grass640 r.in.wms output=elev_us_ned64 \
  mapserver=wms.jpl.nasa.gov/wms.cgi   layers=us_ned format=png \
  wmsquery=version=1.1.1   maxcols=1024 maxrows=1024 \
  wgetoptions=-c -t 5 -nv   curloptions=-C - --retry 5 -s -S \
  method=cubic v=1 --o --v

I get data in the .1 file.

because the format is PNG  style is default, the values refer to  
color
and are in the range of 0-53. To see anything but mostly-black I  
needed

to do:
grass640 r.colors elev_us_ned64.1 col=bcyr

and you get a nice image.


'r.in.wms -l' says the us_ned layer is supposed to show:

LAYER: us_ned
 Title: United States elevation, 30m
 |
 |Continental United States elevation, produced from the  
USGS National Elevation.
 |The default style is scaled to 8 bit from the orginal