[GRASS-dev] Need to update g.setproj

Glynn Clements glynn at gclements.plus.com
Sat Sep 30 22:56:59 EDT 2006


Michael Barton wrote:

> > Is there any real reason why GRASS needs to comprehend the projection
> > parameters, i.e. to have lib/gis/geo_init.c or all of that boilerplate
> > in g.setproj?
> > 
> > IOW, can projection parameters not be treated as opaque key/value
> > pairs which are simply passed straight through to PROJ, with any UI
> > consisting of generic code using an external database[1] of projection
> > parameters?
> > 
> > [1] By which, I mean a text file in an easy-to-parse format.
> > 
> > It seems to me that all of that boilerplate could be replaced by a
> > list of projections (+proj= name, description), a database of
> > parameters (+<opt>= name, description, bool/int/float), and a matrix
> > of "projection X accepts/requires parameter Y with default value Z".
> 
> This seems like it would be a big help in designing a GUI wrapper for these
> functions.

Converting lib/gis/geo_init.c and g.setproj/main.c to text files was
simple enough; those are attached.

AFAICT, it should be straightforward to replace the boilerplate in
g.setproj with code which uses the tables.

In the process, I noticed this in g.setproj/main.c:

	case LAT3:
		sprintf(tmp_buff, "%.10f", LLSTUFF[i]);
		G_set_key_value("lat_2", tmp_buff, out_proj_keys);
		                 ^^^^^

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

-------------- next part --------------
ALPHA:alpha:Azimuth angle at Cartesian Origin
AZIM:azi:Azimuth Angle of Tilt in Decimal degrees
HEIGH:h:Height of Viewing Point in Meters
KFACT:k_0:Scale Factor at the Central Meridian
LAT0:lat_0:Central Parallel
LAT1:lat_1:First Standard Parallel
LAT2:lat_2:Second Standard Parallel
LAT3:lat_3:Third Standard Parallel
LATB:lat_b:Angular Distance from Tangency Point
LATTS:lat_ts:Latitude of True Scale
LON0:lon_0:Central Meridian
LON1:lon_1:First Standard Meridian
LON2:lon_2:Second Standard Meridian
LON3:lon_3:Third Standard Meridian
LONC:lon_c:Longitude of Cartesian Origin
LOTSA:lotsa:LOTSA
MFACT:m:m factor
MSFACT:M:M factor
NFACT:n:n factor
NOCUT:no_cut:Both Hemispheres
NOROT:no_rot:Suppress Rotation
NOSKEW:ns:Suppress Skew
NOUOFF:no_uoff:Suppress Offset from Pre-Rotated Axis
OLATP:o_lat_p:Latitude of New Pole
OLONP:o_lon_p:Longitude of New Pole
QFACT:q:q factor
ROTCONV:rot_conv:Origin Convergence Angle
SNUM:lsat:Satellite Number
SOUTH:south:South Hemisphere
SPATH:path:Satellite Path Number
THETA:theta:Theta Angle
TILT:tilt:Tilt Angle in Decimal Degrees
WFACT:W:W factor
X0:x_0:False Easting
Y0:y_0:False Northing
ZONE:zone:Projection Zone
-------------- next part --------------
AEA:lat_0=ask,23.0;lat_1=ask,29.5;lat_2=ask,45.5;lon_0=ask,-96.0;x_0=ask,0.0;y_0=ask,0.0
AEQD:lat_0=ask,0.0;lon_0=ask,20.0
AIRY:lat_0=ask,0.0;lat_b=ask,90.0;lon_0=ask,20.0;no_cut=ask,nodfl
AITOFF:lat_0=ask,0.0;lon_0=ask,20.0
ALSK:lat_0=noask,64.0;lon_0=noask,-152.0
APIAN:lat_0=ask,0.0;lon_0=ask,20.0
AUGUST:lat_0=ask,0.0;lon_0=ask,20.0
BACON:lat_0=ask,0.0;lon_0=ask,20.0
BIPC:lat_0=ask,0.0;lon_0=ask,-90.0;ns=ask,nodfl
BOGGS:lat_0=ask,0.0;lon_0=ask,20.0
BONNE:lat_1=ask,40.0;lon_0=ask,20.0
CASS:lat_0=ask,0.0;lon_0=ask,20.0
CC:lat_0=ask,0.0;lon_0=ask,20.0
CEA:lat_0=ask,0.0;lat_ts=ask,0.0;lon_0=ask,20.0
CHAMB:lat_0=ask,55.0;lat_1=ask,40.0;lat_2=ask,20.0;lat_3=ask,35.0;lon_0=ask,20.0;lon_1=ask,5.0;lon_2=ask,55.0;lon_3=ask,65.0
COLLG:lat_0=ask,0.0;lon_0=ask,20.0
CRAST:lat_0=ask,0.0;lon_0=ask,20.0
DENOY:lat_0=ask,0.0;lon_0=ask,20.0
ECK1:lat_0=ask,0.0;lon_0=ask,20.0
ECK2:lat_0=ask,0.0;lon_0=ask,20.0
ECK3:lat_0=ask,0.0;lon_0=ask,20.0
ECK4:lat_0=ask,0.0;lon_0=ask,20.0
ECK5:lat_0=ask,0.0;lon_0=ask,20.0
ECK6:lat_0=ask,0.0;lon_0=ask,20.0
EQC:lat_0=ask,0.0;lat_ts=ask,0.0;lon_0=ask,0.0
EQDC:lat_0=ask,40.0;lat_1=ask,20.0;lat_2=ask,60.0;lon_0=ask,20.0
EULER:lat_0=ask,55.0;lat_1=ask,45.0;lat_2=ask,65.0;lon_0=ask,20.0
FAHEY:lat_0=ask,0.0;lon_0=ask,20.0
FOUC:lat_0=ask,0.0;lon_0=ask,20.0
FOUC_S:lat_0=ask,0.0;lon_0=ask,20.0
GALL:lat_0=ask,0.0;lon_0=ask,20.0
GINS8:lat_0=ask,0.0;lon_0=ask,20.0
GNOM:lat_0=ask,0.0;lon_0=ask,20.0
GN_SINU:lat_0=ask,0.0;lon_0=ask,20.0;m=ask,1.0;n=ask,1.0
GOODE:lat_0=ask,0.0;lon_0=ask,20.0
GS48:lat_0=noask,45.0;lon_0=noask,-120.0
GS50:lat_0=noask,45.0;lon_0=noask,-120.0
HAMMER:M=ask,1.0;W=ask,0.5;lat_0=ask,0.0;lon_0=ask,20.0
HATANO:lat_0=ask,0.0;lon_0=ask,20.0
IMW_P:lat_0=ask,0.0;lat_1=ask,20.0;lat_2=ask,60.0;lon_0=ask,20.0;lon_1=ask,20.0
KAV5:lat_0=ask,0.0;lon_0=ask,20.0
KAV7:lat_0=ask,0.0;lon_0=ask,20.0
LABRD:azi=noask,18.9;k_0=noask,0.9995;lat_0=noask,18.9;lon_0=noask,46.437208333;x_0=noask,400000.0;y_0=noask,800000.0
LAEA:lat_0=ask,55.0;lon_0=ask,20.0;x_0=ask,0.0;y_0=ask,0.0
LAGRNG:W=ask,2.0;lat_0=ask,0.0;lat_1=ask,0.0;lon_0=ask,20.0
LARR:lat_0=ask,0.0;lon_0=ask,20.0
LASK:lat_0=ask,0.0;lon_0=ask,20.0
LCC:lat_0=ask,23.0;lat_1=ask,33.0;lat_2=ask,45.0;lon_0=ask,-96.0;x_0=ask,0.0;y_0=ask,0.0
LEAC:lat_0=ask,55.0;lat_1=ask,0.0;lon_0=ask,20.0;south=ask,nodfl
LEE_OS:lat_0=noask,-10.0;lon_0=noask,-165.0
LOXIM:lat_0=ask,0.0;lat_1=ask,45.0;lon_0=ask,20.0
LSAT:lat_0=ask,0.0;lon_0=ask,20.0;lsat=ask,1;path=ask,1
MBTFPP:lat_0=ask,0.0;lon_0=ask,20.0
MBTFPQ:lat_0=ask,0.0;lon_0=ask,20.0
MBTFPS:lat_0=ask,0.0;lon_0=ask,20.0
MBT_FPS:lat_0=ask,0.0;lon_0=ask,20.0
MBT_S:lat_0=ask,0.0;lon_0=ask,20.0
MERC:k_0=ask,1.0;lat_ts=ask,0.;lon_0=ask,-96.0
MILL:lat_0=ask,0.0;lon_0=ask,20.0
MIL_OS:lat_0=noask,18.0;lon_0=noask,20.0
MOLL:lat_0=ask,0.0;lon_0=ask,20.0
MPOLY:lat_0=ask,0.0;lat_1=ask,-20.0;lat_2=ask,20.0;lon_0=ask,20.0;lotsa=ask,nodfl
MURD1:lat_0=ask,0.0;lat_1=ask,-20.0;lat_2=ask,20.0;lon_0=ask,20.0
MURD2:lat_0=ask,0.0;lat_1=ask,-20.0;lat_2=ask,20.0;lon_0=ask,20.0
MURD3:lat_0=ask,0.0;lat_1=ask,-20.0;lat_2=ask,20.0;lon_0=ask,20.0
NELL:lat_0=ask,0.0;lon_0=ask,20.0
NELL_H:lat_0=ask,0.0;lon_0=ask,20.0
NICOL:lat_0=ask,0.0;lon_0=ask,20.0
NSPER:h=ask,50000000.0;lat_0=ask,55.0;lon_0=ask,20.0
NZMG:lat_0=noask,-41.0;lon_0=noask,173.0;x_0=noask,2510000.0;y_0=noask,6023150.0
OB_TRAN:lat_0=ask,0.0;lon_0=ask,0.0;o_lat_p=ask,90.0;o_lon_p=ask,0.0
OCEA:lat_0=ask,0.0;lat_1=ask,-45.0;lat_2=ask,45.0;lon_0=ask,20.0;lon_1=ask,-20.0;lon_2=ask,60.0
OEA:lat_0=ask,0.0;lon_0=ask,20.0;m=ask,1.0;n=ask,1.0;theta=ask,0.0
OMERC:k_0=ask,1.0;lat_0=ask,0.0;lat_1=ask,-45.0;lat_2=ask,45.0;lon_0=ask,20.0;lon_1=ask,-40.0;lon_2=ask,40.0;no_rot=ask,nodfl;no_uoff=ask,nodfl;rot_conv=ask,nodfl
ORTEL:lat_0=ask,0.0;lon_0=ask,20.0
ORTHO:lat_0=ask,0.0;lon_0=ask,20.0
PCONIC:lat_0=ask,0.0;lat_1=ask,33.0;lat_2=ask,45.0;lon_0=ask,20.0
POLY:lat_0=ask,0.0;lon_0=ask,-90.0
PUTP1:lat_0=ask,0.0;lon_0=ask,20.0
PUTP2:lat_0=ask,0.0;lon_0=ask,20.0
PUTP3:lat_0=ask,0.0;lon_0=ask,20.0
PUTP3P:lat_0=ask,0.0;lon_0=ask,20.0
PUTP4P:lat_0=ask,0.0;lon_0=ask,20.0
PUTP5:lat_0=ask,0.0;lon_0=ask,20.0
PUTP5P:lat_0=ask,0.0;lon_0=ask,20.0
PUTP6:lat_0=ask,0.0;lon_0=ask,20.0
PUTP6P:lat_0=ask,0.0;lon_0=ask,20.0
QUA_AUT:lat_0=ask,0.0;lon_0=ask,20.0
ROBIN:lat_0=ask,0.0;lon_0=ask,20.0
RPOLY:lat_0=ask,0.0;lat_ts=ask,0.0;lon_0=ask,20.0
SINU:lat_0=ask,0.0;lon_0=ask,20.0
SOMERC:k_0=noask,1.0;lat_0=noask,46.952405556;lon_0=noask,7.4395833333;x_0=noask,600000.0;y_0=noask,200000.0
STERE:k_0=ask,1.0;lat_0=ask,0.0;lat_ts=ask,0.0;lon_0=ask,20.0
TCC:lat_0=ask,0.0;lon_0=ask,20.0
TCEA:k_0=ask,1.0;lat_0=ask,0.0;lon_0=ask,20.0
TISSOT:lat_0=ask,0.0;lat_1=ask,-30.0;lat_2=ask,45.0;lon_0=ask,20.0
TMERC:k_0=ask,1.0;lat_0=ask,23.0;lon_0=ask,-96.0;x_0=ask,0.0;y_0=ask,0.0
TPEQD:lat_0=ask,0.0;lat_1=ask,-45.0;lat_2=ask,45.0;lon_0=ask,20.0;lon_1=ask,-20.0;lon_2=ask,60.0
TPERS:azi=ask,0.0;h=ask,10000.0;lat_0=ask,0.0;lon_0=ask,20.0;tilt=ask,0.0
UPS:south=ask,nodfl
URM5:alpha=ask,0.0;lat_0=ask,0.0;lon_0=ask,20.0;n=ask,1.0;q=ask,1.0
URMFPS:lat_0=ask,0.0;lon_0=ask,20.0;n=ask,1.0
UTM:south=ask,nodfl;zone=ask,nodfl
VANDG:lat_0=ask,0.0;lon_0=ask,20.0
VANDG2:lat_0=ask,0.0;lon_0=ask,20.0
VANDG3:lat_0=ask,0.0;lon_0=ask,20.0
VANDG4:lat_0=ask,0.0;lon_0=ask,20.0
WAG1:lat_0=ask,0.0;lon_0=ask,20.0
WAG2:lat_0=ask,0.0;lon_0=ask,20.0
WAG3:lat_0=ask,0.0;lon_0=ask,20.0
WAG4:lat_0=ask,0.0;lon_0=ask,20.0
WAG5:lat_0=ask,0.0;lon_0=ask,20.0
WAG6:lat_0=ask,0.0;lon_0=ask,20.0
WAG7:lat_0=ask,0.0;lon_0=ask,20.0
WEREN:lat_0=ask,0.0;lon_0=ask,20.0
WINK1:lat_0=ask,0.0;lat_ts=ask,0.0;lon_0=ask,20.0
WINK2:lat_0=ask,0.0;lat_1=ask,0.0;lon_0=ask,20.0
WINTRI:lat_0=ask,0.0;lat_1=ask,0.0;lon_0=ask,20.0


More information about the grass-dev mailing list