FW: newbie on projection/datum

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

FW: newbie on projection/datum

Randy George

Hi Gerald,

 

> It does input my 3 polygons inside the new table with lat around 22 and long 0.xxx. Is it normal for the long?
No, that doesn’t sound right -  longitude should be somewhere around 113º 32' 11'' E.  Latitude sounds right for lat origin 22º 12' 44'' N. Something apparently isn’t correct on the spatial_ref_sys entry or the data is a long way from the transverse mercator meridian. Check over the spatial_ref_sys again. Its easy to make a mistake.

 

Also it sounds like from the way you are creating ‘basemap_land’ that you may not have an entry in the PostGIS geometry_columns table. If I recall correctly GeoServer will not find the geometry column when attempting to create a feature type unless there is a record in the geometry_columns table

 

You can do this manually with an insert similar to this:

INSERT INTO geometry_columns (f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") VALUES ('', 'public', 'table', 'the_geom', 2, 104309, 'LINESTRING');

 

Or better approach, use the PostGIS AddGeometryColumn function similar to this:

select AddGeometryColumn('DB',’table','the_geom','104309','LINESTRING',2);

 

syntax found here http://postgis.refractions.net/docs/ch04.html#id2523380

  • AddGeometryColumn(<schema_name>, <table_name>,
  •             <column_name>, <srid>, <type>, <dimension>)

 

Randy George

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Gerald Estadieu
Sent: Friday, July 07, 2006 12:39 PM
To: Randy George; [hidden email]
Subject: Re: [Geoserver-users] newbie on projection/datum

 

Hi Randy,

thanks for this very details information, that's what I needed to understand.
Here is what I have done so far:
- insert my SRS into Geoserver gt2-epsg.jar and it appears on the list in the web admin. When I connect to postgis and input it, it shows me long/lat around 113 and 22 which are corresponding to the positionning of Macao.
- insert the SRS into my database in spatial_ref_sys (btw I could not find in the list the one you mention 104106 from ESRI, is it normal?).
Until now, my geom column was in SRID=-1, so I change it to the new one 104309 (sometimes does not work due to some 'violation' by some row, I have to investigate on this probably).
I tried to create a similar table with srid 4326 and do an:

insert into basemap_land select gid,entity,layer,"level",elevation,color,Transform(the_geom,4326) from land_2005;

It does input my 3 polygons inside the new table with lat around 22 and long 0.xxx. Is it normal for the long?
Moreover when I try to make it as a feature type in geoserver, it cannot detect the srs and if I put 4326 it keeps telling me

'The FeatureType 'basemap_land' has a NULL extent.
HINT: the dataset is empty or has no default geometry attribute.'

The dataset is not empty and there is one geometry column. Is it because the CRS is not correct and so the transform is not working well?

here is the SQL I use to create my new table (based on the existing one):
CREATE TABLE basemap_land
(
  gid serial NOT NULL,
  entity varchar(14),
  layer varchar(32),
  "level" int8,
  elevation float8,
  color int4,
  the_geom geometry,
  CONSTRAINT basemap_land_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326)
)
WITH OIDS;
ALTER TABLE basemap_land OWNER TO postgres;


For information I use geoserver 1.3.2 (btw, I read there is a sld wizard but no where there is a link to access it...unless I am nuts).

I can see I am getting close to the stage where it can works...hope someone can help me again to understand this area where I am really a newbie, still.
Thanks

Gerald

On 7/6/06, Randy George <[hidden email]> wrote:


Hi Gerald,

        One further caveat, if you are planning to use the WFS service as
well as the WMS you will probably want to just convert your geometry to SRS
4326. The re-projection capability of WFS is evidently defined at OGC
(WFS1.1) and plans to implement in GeoServer appear to be down the road
slightly with 1.4.?

I.      If you want GeoServer WMS to recognize your CRS you will need to add
some information to GeoServer since I don't think this is a common EPSG.

You would need to modify the gt2-epsg.jar adding a new custom CRS definition
to the end of the \org\geotools\referencing\crs\epsg.properties file.

For example substituting your Macau Special Administration parameters and
making use of the existing EPSG Datum 104106:

104309=PROJCS["Macau Special Admin",
GEOGCS["GCS_Datum_Lisboa_Hayford",DATUM["D_Datum_Lisboa_Hayford",SPHEROID["I
nternational_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree", 0.01745
3292519943295],AUTHORITY["ESRI","104106"]]
,PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",22.212222]
,PARAMETER["central_meridian",113.536389 ],PARAMETER["scale_factor",1.0],PARA
METER["false_easting",20000],PARAMETER["false_northing",20000],UNIT["metre",
1,AUTHORITY["EPSG","9001"]],AUTHORITY["Macau Special Admin","104309"]]

(Note that I didn't check this against real data)


II. If you want both WMS and WFS to serve your data source you should
transform your datastore geometry to 4326 (or wait for 1.4.? release).

        If you have a coord transform package with your CRS you could just
change from the Macau CRS to 4326. Another way to do this if you have
PostGIS is to add a new record to the spatial_ref_sys of your database.
        Looking at the Macau Special Administration parameters you listed, I
think you could take 'ESRI 102160' from the modified spatial_ref_sys table
of PostGIS and modify it with your origin and false easting,northing.

   Latitude of Origin    :    22º 12' 44'' N = 22.212222
   Longitude of Origin    :    113º 32' 11'' E = 113.536389
   False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
   False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]

For example changing from 102160 ESRI in the PostGIS spatial_ref_sys table
you would have something like this:

INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)
VALUES (104309, 'Macau Special Admin', 104309,
'PROJCS["Datum_73_Hayford_Gauss_IGeoE",GEOGCS["GCS_Datum_73",DATUM["D_Datum_
73",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["
Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["
False_Easting", 20000.0],PARAMETER["False_Northing",20000.0],PARAMETER["Centr
al_Meridian",113.536389],PARAMETER["Scale_Factor",1],PARAMETER["Latitude_Of_
Origin",39.66666666666666],UNIT["Meter",1]]', '+proj=tmerc +lat_0= 22.212222
+lon_0=113.536389 +k=1.000000 +x_0=20000.0 +y_0=20000.0 +ellps=intl
+units=m');

Once you have your CRS defined in the spatial_ref_sys you should be able to
get the transformed coordinates like this:

SELECT asewkt(transform(the_geom),4326) from your_table;

I hope this helps more than hinders, but when you have a non standard
coordinate system it does take some playing around to get things to work. I
know this from recent experience and Chris Holmes helpfully pointed out that
the WFS re-projection is a future feature.

Thanks
Randy George
www.cadmaps.com






-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Brent
Owens
Sent: Tuesday, July 04, 2006 9:23 AM
To: Gerald Estadieu
Cc: [hidden email]
Subject: Re: [Geoserver-users] newbie on projection/datum

You should always tell geoserver what projection your data is in, even
if it is the regular 4326 lat/lon projection. The data in the database
should also be in the same projection and you should specify that in
postgis.
When a request comes in from mapbuilder or udig, a "requested" SRS value
is sent. Geoserver will look at that value, then look at the SRS of the
data. If they are different, it will reproject the data for you into the
"requested" projection.

Brent Owens
(The Open Planning Project)



Gerald Estadieu wrote:
> Hi all,
>
> I know it is not the first time someone ask this kind of question but
> I still need some clarification from some experts here. I have a
> dataset from Macao to setup a demo on PostGIS/Geoserver +
> mapBuilder/uDig as a feasibility study. I got the all thing in
> shapefiles without any .prj file but I got a document with the following:
>
> ======================================================
> Coordinates
>
> Projection of Special Administrative Region of Macau
>
> Transverse Mercator Projection.
>
> Ellipsoid:
>
> ·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
> ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
> 298.25722357000)
>
>
> Origin
>
> The following "datum" has been taken as the origin of the network for
> Special Administrative Region of Macau:
>
> Longitude: 113º 32' 11'' E
> Latitude: 22º 12' 44'' N
>
> and the following as the corresponding rectangular coordinates:
>
> 20 000.000 m N and 20 000.000 m E
>
>
> Projection parameters
>
> International Hayford
>
> Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
> f (Flattening) = 1/297
> Projection        :    Transverse Mercator Projection
> Latitude of Origin    :    22º 12' 44'' N
> Longitude of Origin    :    113º 32' 11'' E
> False Easting        :    20,000.000 m (meters) [X=x+20, 000.000 m]
> False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
> Datum Level        :    Mean Sea Level
> Scale Factor        :    1
> ====================================================
>
> I imported all feature type in PostGIS but my SRID is -1 so far (which
> is normal since I did not specify anything). I can access my data in
> uDig/qGIS no problem when I use directly PostGIS but not when I use
> GeoServer with mapbuilder (probably due to the missing CRS). In
> Geoserver I declared my feature type in EPSG:4326 and everything has
> been accepted and validated by GeoServer.
> Here are a few questions I have to understand how to make the all
> things properly in PostGIS and GeoServer
> - Should I insert the CRS in PostGIS/Geoserver as defined above or it
> is better to make a kind of "translation" in my data through some SQL
> code to make it fit in the 4326 system?
> - based on the above CRS definition how can I write it in the EPSG
> format? I am not sure I understand how it is written. I believe I have
> everything to do it but how? Good question!!! Again isn't it easier to
> "translate" my data (since I can see that I have a North and East
> translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
> SPHEROID["WGS 84", 6378137.0 , 298.257223563,
> AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
> 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
> AUTHORITY["EPSG","4326"]])
>
> I would appreciate some lights on my missing knowledge on this area!
>
> Gerald
> ------------------------------------------------------------------------
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

 


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: projection/datum - SLD

Gérald Estadieu-4
Hi Randy,

thanks again for your answer. You were right! I made a mistake in the proj4 column in the spatial_ref_sys. Everything is ok now, althought I have now to create a Mapbuilder custom apps. Moreover I had a problem with my SLDs. I generated them in uDig but geoserver does not work well with them although it validated them. When I created new one based on the default one in geoserver it all works fine. Is there any bug?

Beside I am doing simple SLDs for "standard" basemap information such as land, water, streets, park, buildings based on color from Google Maps, is there any interest to include them in standard in GeoServer to give nicer examples of map out-of-the-box. Of course I understand that for highways/avenues/streets in Google Maps it really depends on the data model but it is pretty easy to have a basic set that can fit most usual cases.
I did not find a way to test the SLD wizard in GeoServer 1.3.2 (how can I access to it?) so maybe what I proposed is useless already!!!

Gerald



On Jul 8, 2006, at 5:33 AM, Randy George wrote:

Hi Gerald,

 

> It does input my 3 polygons inside the new table with lat around 22 and long 0.xxx. Is it normal for the long?
No, that doesn’t sound right -  longitude should be somewhere around 113º 32' 11'' E.  Latitude sounds right for lat origin 22º 12' 44'' N. Something apparently isn’t correct on the spatial_ref_sys entry or the data is a long way from the transverse mercator meridian. Check over the spatial_ref_sys again. Its easy to make a mistake.

 

Also it sounds like from the way you are creating ‘basemap_land’ that you may not have an entry in the PostGIS geometry_columns table. If I recall correctly GeoServer will not find the geometry column when attempting to create a feature type unless there is a record in the geometry_columns table

 

You can do this manually with an insert similar to this:

INSERT INTO geometry_columns (f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, "type") VALUES ('', 'public', 'table', 'the_geom', 2, 104309, 'LINESTRING');

 

Or better approach, use the PostGIS AddGeometryColumn function similar to this:

select AddGeometryColumn('DB',’table','the_geom','104309','LINESTRING',2);

 

syntax found here http://postgis.refractions.net/docs/ch04.html#id2523380

  • AddGeometryColumn(<schema_name>, <table_name>,
  •             <column_name>, <srid>, <type>, <dimension>)

 

Randy George

 


From: [hidden email] [[hidden email]] On Behalf Of Gerald Estadieu
Sent: Friday, July 07, 2006 12:39 PM
To: Randy George; [hidden email]
Subject: Re: [Geoserver-users] newbie on projection/datum

 

Hi Randy,

thanks for this very details information, that's what I needed to understand.
Here is what I have done so far:
- insert my SRS into Geoserver gt2-epsg.jar and it appears on the list in the web admin. When I connect to postgis and input it, it shows me long/lat around 113 and 22 which are corresponding to the positionning of Macao.
- insert the SRS into my database in spatial_ref_sys (btw I could not find in the list the one you mention 104106 from ESRI, is it normal?).
Until now, my geom column was in SRID=-1, so I change it to the new one 104309 (sometimes does not work due to some 'violation' by some row, I have to investigate on this probably).
I tried to create a similar table with srid 4326 and do an:

insert into basemap_land select gid,entity,layer,"level",elevation,color,Transform(the_geom,4326) from land_2005;

It does input my 3 polygons inside the new table with lat around 22 and long 0.xxx. Is it normal for the long?
Moreover when I try to make it as a feature type in geoserver, it cannot detect the srs and if I put 4326 it keeps telling me

'The FeatureType 'basemap_land' has a NULL extent.
HINT: the dataset is empty or has no default geometry attribute.'

The dataset is not empty and there is one geometry column. Is it because the CRS is not correct and so the transform is not working well?

here is the SQL I use to create my new table (based on the existing one):
CREATE TABLE basemap_land
(
  gid serial NOT NULL,
  entity varchar(14),
  layer varchar(32),
  "level" int8,
  elevation float8,
  color int4,
  the_geom geometry,
  CONSTRAINT basemap_land_pkey PRIMARY KEY (gid),
  CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 'MULTIPOLYGON'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326)
)
WITH OIDS;
ALTER TABLE basemap_land OWNER TO postgres;


For information I use geoserver 1.3.2 (btw, I read there is a sld wizard but no where there is a link to access it...unless I am nuts).

I can see I am getting close to the stage where it can works...hope someone can help me again to understand this area where I am really a newbie, still.
Thanks

Gerald

On 7/6/06, Randy George <[hidden email]> wrote:


Hi Gerald,

        One further caveat, if you are planning to use the WFS service as
well as the WMS you will probably want to just convert your geometry to SRS
4326. The re-projection capability of WFS is evidently defined at OGC
(WFS1.1) and plans to implement in GeoServer appear to be down the road
slightly with 1.4.?

I.      If you want GeoServer WMS to recognize your CRS you will need to add
some information to GeoServer since I don't think this is a common EPSG.

You would need to modify the gt2-epsg.jar adding a new custom CRS definition
to the end of the \org\geotools\referencing\crs\epsg.properties file.

For example substituting your Macau Special Administration parameters and
making use of the existing EPSG Datum 104106:

104309=PROJCS["Macau Special Admin",
GEOGCS["GCS_Datum_Lisboa_Hayford",DATUM["D_Datum_Lisboa_Hayford",SPHEROID["I
nternational_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree", 0.01745
3292519943295],AUTHORITY["ESRI","104106"]]
,PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",22.212222]
,PARAMETER["central_meridian",113.536389 ],PARAMETER["scale_factor",1.0],PARA
METER["false_easting",20000],PARAMETER["false_northing",20000],UNIT["metre",
1,AUTHORITY["EPSG","9001"]],AUTHORITY["Macau Special Admin","104309"]]

(Note that I didn't check this against real data)


II. If you want both WMS and WFS to serve your data source you should
transform your datastore geometry to 4326 (or wait for 1.4.? release).

        If you have a coord transform package with your CRS you could just
change from the Macau CRS to 4326. Another way to do this if you have
PostGIS is to add a new record to the spatial_ref_sys of your database.
        Looking at the Macau Special Administration parameters you listed, I
think you could take 'ESRI 102160' from the modified spatial_ref_sys table
of PostGIS and modify it with your origin and false easting,northing.

   Latitude of Origin    :    22º 12' 44'' N = 22.212222
   Longitude of Origin    :    113º 32' 11'' E = 113.536389
   False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
   False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]

For example changing from 102160 ESRI in the PostGIS spatial_ref_sys table
you would have something like this:

INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)
VALUES (104309, 'Macau Special Admin', 104309,
'PROJCS["Datum_73_Hayford_Gauss_IGeoE",GEOGCS["GCS_Datum_73",DATUM["D_Datum_
73",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["
Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["
False_Easting", 20000.0],PARAMETER["False_Northing",20000.0],PARAMETER["Centr
al_Meridian",113.536389],PARAMETER["Scale_Factor",1],PARAMETER["Latitude_Of_
Origin",39.66666666666666],UNIT["Meter",1]]', '+proj=tmerc +lat_0= 22.212222
+lon_0=113.536389 +k=1.000000 +x_0=20000.0 +y_0=20000.0 +ellps=intl
+units=m');

Once you have your CRS defined in the spatial_ref_sys you should be able to
get the transformed coordinates like this:

SELECT asewkt(transform(the_geom),4326) from your_table;

I hope this helps more than hinders, but when you have a non standard
coordinate system it does take some playing around to get things to work. I
know this from recent experience and Chris Holmes helpfully pointed out that
the WFS re-projection is a future feature.

Thanks
Randy George
www.cadmaps.com






-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Brent
Owens
Sent: Tuesday, July 04, 2006 9:23 AM
To: Gerald Estadieu
Cc: [hidden email]
Subject: Re: [Geoserver-users] newbie on projection/datum

You should always tell geoserver what projection your data is in, even
if it is the regular 4326 lat/lon projection. The data in the database
should also be in the same projection and you should specify that in

Reply | Threaded
Open this post in threaded view
|

Re: projection/datum - SLD

Chris Holmes-2


Gérald Estadieu wrote:
> Hi Randy,
>
> thanks again for your answer. You were right! I made a mistake in the
> proj4 column in the spatial_ref_sys. Everything is ok now, althought I
> have now to create a Mapbuilder custom apps. Moreover I had a problem
> with my SLDs. I generated them in uDig but geoserver does not work well
> with them although it validated them. When I created new one based on
> the default one in geoserver it all works fine. Is there any bug?
Not sure, what's the behavior you're getting?  I can try to do the same
and see, it is supposed to be working, and indeed we use the same code
as uDig.

>
> Beside I am doing simple SLDs for "standard" basemap information such as
> land, water, streets, park, buildings based on color from Google Maps,
> is there any interest to include them in standard in GeoServer to give
> nicer examples of map out-of-the-box. Of course I understand that for
> highways/avenues/streets in Google Maps it really depends on the data
> model but it is pretty easy to have a basic set that can fit most usual
> cases.
Oh oh!  Yes please, I was actually really hoping to do this very soon
myself.  Are you doing it off of tiger data?  Or some other data set?
If not tiger I'm happy to adapt it.  We're planning on standing up a
server for all of tiger data, see:
http://geo.openplans.org/cholmes/ol-cache.html for what we've got so
far.  I'd love to have a gmaps look alike interface for it.  We're
hoping eventually to have the ability for users to actually interact
with the data model, modify the road attributes so that 'major roads'
are styled better.  So start with tiger and hopefully get it closer to
the quality of gmaps.  A good place to post them would be at:
http://docs.codehaus.org/display/GEOSDOC/SLD+Snippets

> I did not find a way to test the SLD wizard in GeoServer 1.3.2 (how can
> I access to it?) so maybe what I proposed is useless already!!!
We wish ;)  No, the sld wizard is very basic as you'll see.  You can
access it by going to Config -> Data -> Feature Type -> Edit (I think)
and there should be a link to 'create new SLD' there.

best regards,

Chris

>
> Gerald
>
>
>
> On Jul 8, 2006, at 5:33 AM, Randy George wrote:
>
>> Hi Gerald,
>>
>>  
>>
>> > It does input my 3 polygons inside the new table with lat around 22
>> and long 0.xxx. Is it normal for the long?
>> No, that doesn’t sound right -  longitude should be somewhere around
>> 113º 32' 11'' E.  Latitude sounds right for lat origin 22º 12' 44'' N.
>> Something apparently isn’t correct on the spatial_ref_sys entry or the
>> data is a long way from the transverse mercator meridian. Check over
>> the spatial_ref_sys again. Its easy to make a mistake.
>>
>>  
>>
>> Also it sounds like from the way you are creating ‘basemap_land’ that
>> you may not have an entry in the PostGIS geometry_columns table. If I
>> recall correctly GeoServer will not find the geometry column when
>> attempting to create a feature type unless there is a record in the
>> geometry_columns table
>>
>>  
>>
>> You can do this manually with an insert similar to this:
>>
>> INSERT INTO geometry_columns (f_table_catalog, f_table_schema,
>> f_table_name, f_geometry_column, coord_dimension, srid, "type") VALUES
>> ('', 'public', 'table', 'the_geom', 2, 104309, 'LINESTRING');
>>
>>  
>>
>> Or better approach, use the PostGIS AddGeometryColumn function similar
>> to this:
>>
>> select AddGeometryColumn('DB',’table','the_geom','104309','LINESTRING',2);
>>
>>  
>>
>> syntax found here http://postgis.refractions.net/docs/ch04.html#id2523380
>>
>>     * AddGeometryColumn(<schema_name>, <table_name>,
>>     *             <column_name>, <srid>, <type>, <dimension>)
>>
>>  
>>
>> Randy George
>>
>>  
>>
>> ------------------------------------------------------------------------
>>
>> *From:* [hidden email]
>> [mailto:[hidden email]] *On Behalf Of
>> *Gerald Estadieu
>> *Sent:* Friday, July 07, 2006 12:39 PM
>> *To:* Randy George; [hidden email]
>> <mailto:[hidden email]>
>> *Subject:* Re: [Geoserver-users] newbie on projection/datum
>>
>>  
>>
>> Hi Randy,
>>
>> thanks for this very details information, that's what I needed to
>> understand.
>> Here is what I have done so far:
>> - insert my SRS into Geoserver gt2-epsg.jar and it appears on the list
>> in the web admin. When I connect to postgis and input it, it shows me
>> long/lat around 113 and 22 which are corresponding to the positionning
>> of Macao.
>> - insert the SRS into my database in spatial_ref_sys (btw I could not
>> find in the list the one you mention 104106 from ESRI, is it normal?).
>> Until now, my geom column was in SRID=-1, so I change it to the new
>> one 104309 (sometimes does not work due to some 'violation' by some
>> row, I have to investigate on this probably).
>> I tried to create a similar table with srid 4326 and do an:
>>
>> insert into basemap_land select
>> gid,entity,layer,"level",elevation,color,Transform(the_geom,4326) from
>> land_2005;
>>
>> It does input my 3 polygons inside the new table with lat around 22
>> and long 0.xxx. Is it normal for the long?
>> Moreover when I try to make it as a feature type in geoserver, it
>> cannot detect the srs and if I put 4326 it keeps telling me
>>
>> 'The FeatureType 'basemap_land' has a NULL extent.
>> HINT: the dataset is empty or has no default geometry attribute.'
>>
>> The dataset is not empty and there is one geometry column. Is it
>> because the CRS is not correct and so the transform is not working well?
>>
>> here is the SQL I use to create my new table (based on the existing one):
>> CREATE TABLE basemap_land
>> (
>>   gid serial NOT NULL,
>>   entity varchar(14),
>>   layer varchar(32),
>>   "level" int8,
>>   elevation float8,
>>   color int4,
>>   the_geom geometry,
>>   CONSTRAINT basemap_land_pkey PRIMARY KEY (gid),
>>   CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
>>   CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
>> 'MULTIPOLYGON'::text OR the_geom IS NULL),
>>   CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326)
>> )
>> WITH OIDS;
>> ALTER TABLE basemap_land OWNER TO postgres;
>>
>>
>> For information I use geoserver 1.3.2 (btw, I read there is a sld
>> wizard but no where there is a link to access it...unless I am nuts).
>>
>> I can see I am getting close to the stage where it can works...hope
>> someone can help me again to understand this area where I am really a
>> newbie, still.
>> Thanks
>>
>> Gerald
>>
>> On 7/6/06, *Randy George* <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>
>> Hi Gerald,
>>
>>         One further caveat, if you are planning to use the WFS service as
>> well as the WMS you will probably want to just convert your geometry
>> to SRS
>> 4326. The re-projection capability of WFS is evidently defined at OGC
>> (WFS1.1) and plans to implement in GeoServer appear to be down the road
>> slightly with 1.4.?
>>
>> I.      If you want GeoServer WMS to recognize your CRS you will need
>> to add
>> some information to GeoServer since I don't think this is a common EPSG.
>>
>> You would need to modify the gt2-epsg.jar adding a new custom CRS
>> definition
>> to the end of the \org\geotools\referencing\crs\epsg.properties file.
>>
>> For example substituting your Macau Special Administration parameters and
>> making use of the existing EPSG Datum 104106:
>>
>> 104309=PROJCS["Macau Special Admin",
>> GEOGCS["GCS_Datum_Lisboa_Hayford",DATUM["D_Datum_Lisboa_Hayford",SPHEROID["I
>> nternational_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree",
>> 0.01745
>> 3292519943295],AUTHORITY["ESRI","104106"]]
>> ,PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",22.212222]
>> ,PARAMETER["central_meridian",113.536389
>> ],PARAMETER["scale_factor",1.0],PARA
>> METER["false_easting",20000],PARAMETER["false_northing",20000],UNIT["metre",
>> 1,AUTHORITY["EPSG","9001"]],AUTHORITY["Macau Special Admin","104309"]]
>>
>> (Note that I didn't check this against real data)
>>
>>
>> II. If you want both WMS and WFS to serve your data source you should
>> transform your datastore geometry to 4326 (or wait for 1.4.? release).
>>
>>         If you have a coord transform package with your CRS you could
>> just
>> change from the Macau CRS to 4326. Another way to do this if you have
>> PostGIS is to add a new record to the spatial_ref_sys of your database.
>>         Looking at the Macau Special Administration parameters you
>> listed, I
>> think you could take 'ESRI 102160' from the modified spatial_ref_sys table
>> of PostGIS and modify it with your origin and false easting,northing.
>>
>>    Latitude of Origin    :    22º 12' 44'' N = 22.212222
>>    Longitude of Origin    :    113º 32' 11'' E = 113.536389
>>    False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
>>    False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
>>
>> For example changing from 102160 ESRI in the PostGIS spatial_ref_sys
>> table
>> you would have something like this:
>>
>> INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext,
>> proj4text)
>> VALUES (104309, 'Macau Special Admin', 104309,
>> 'PROJCS["Datum_73_Hayford_Gauss_IGeoE",GEOGCS["GCS_Datum_73",DATUM["D_Datum_
>>
>> 73",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["
>> Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["
>> False_Easting",
>> 20000.0],PARAMETER["False_Northing",20000.0],PARAMETER["Centr
>> al_Meridian",113.536389],PARAMETER["Scale_Factor",1],PARAMETER["Latitude_Of_
>> Origin",39.66666666666666],UNIT["Meter",1]]', '+proj=tmerc +lat_0=
>> 22.212222
>> +lon_0=113.536389 +k=1.000000 +x_0=20000.0 +y_0=20000.0 +ellps=intl
>> +units=m');
>>
>> Once you have your CRS defined in the spatial_ref_sys you should be
>> able to
>> get the transformed coordinates like this:
>>
>> SELECT asewkt(transform(the_geom),4326) from your_table;
>>
>> I hope this helps more than hinders, but when you have a non standard
>> coordinate system it does take some playing around to get things to
>> work. I
>> know this from recent experience and Chris Holmes helpfully pointed
>> out that
>> the WFS re-projection is a future feature.
>>
>> Thanks
>> Randy George
>> www.cadmaps.com <http://www.cadmaps.com>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: [hidden email]
>> <mailto:[hidden email]>
>> [mailto: [hidden email]
>> <mailto:[hidden email]>] On Behalf Of Brent
>> Owens
>> Sent: Tuesday, July 04, 2006 9:23 AM
>> To: Gerald Estadieu
>> Cc: [hidden email]
>> <mailto:[hidden email]>
>> Subject: Re: [Geoserver-users] newbie on projection/datum
>>
>> You should always tell geoserver what projection your data is in, even
>> if it is the regular 4326 lat/lon projection. The data in the database
>> should also be in the same projection and you should specify that in
>> postgis.
>> When a request comes in from mapbuilder or udig, a "requested" SRS value
>> is sent. Geoserver will look at that value, then look at the SRS of the
>> data. If they are different, it will reproject the data for you into the
>> "requested" projection.
>>
>> Brent Owens
>> (The Open Planning Project)
>>
>>
>>
>> Gerald Estadieu wrote:
>> > Hi all,
>> >
>> > I know it is not the first time someone ask this kind of question but
>> > I still need some clarification from some experts here. I have a
>> > dataset from Macao to setup a demo on PostGIS/Geoserver +
>> > mapBuilder/uDig as a feasibility study. I got the all thing in
>> > shapefiles without any .prj file but I got a document with the following:
>> >
>> > ======================================================
>> > Coordinates
>> >
>> > Projection of Special Administrative Region of Macau
>> >
>> > Transverse Mercator Projection.
>> >
>> > Ellipsoid:
>> >
>> > ·    International Hayford (a = 6,378, 388.000 m, 1/f = 297.00000000000)
>> > ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
>> > 298.25722357000)
>> >
>> >
>> > Origin
>> >
>> > The following "datum" has been taken as the origin of the network for
>> > Special Administrative Region of Macau:
>> >
>> > Longitude: 113º 32' 11'' E
>> > Latitude: 22º 12' 44'' N
>> >
>> > and the following as the corresponding rectangular coordinates:
>> >
>> > 20 000.000 m N and 20 000.000 m E
>> >
>> >
>> > Projection parameters
>> >
>> > International Hayford
>> >
>> > Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
>> > f (Flattening) = 1/297
>> > Projection        :    Transverse Mercator Projection
>> > Latitude of Origin    :    22º 12' 44'' N
>> > Longitude of Origin    :    113º 32' 11'' E
>> > False Easting        :    20,000.000 m (meters) [X=x+20, 000.000 m]
>> > False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
>> > Datum Level        :    Mean Sea Level
>> > Scale Factor        :    1
>> > ====================================================
>> >
>> > I imported all feature type in PostGIS but my SRID is -1 so far (which
>> > is normal since I did not specify anything). I can access my data in
>> > uDig/qGIS no problem when I use directly PostGIS but not when I use
>> > GeoServer with mapbuilder (probably due to the missing CRS). In
>> > Geoserver I declared my feature type in EPSG:4326 and everything has
>> > been accepted and validated by GeoServer.
>> > Here are a few questions I have to understand how to make the all
>> > things properly in PostGIS and GeoServer
>> > - Should I insert the CRS in PostGIS/Geoserver as defined above or it
>> > is better to make a kind of "translation" in my data through some SQL
>> > code to make it fit in the 4326 system?
>> > - based on the above CRS definition how can I write it in the EPSG
>> > format? I am not sure I understand how it is written. I believe I have
>> > everything to do it but how? Good question!!! Again isn't it easier to
>> > "translate" my data (since I can see that I have a North and East
>> > translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
>> > SPHEROID["WGS 84", 6378137.0 , 298.257223563,
>> > AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
>> > PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
>> > 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
>> > AUTHORITY["EPSG","4326"]])
>> >
>> > I would appreciate some lights on my missing knowledge on this area!
>> >
>> > Gerald
>> > ------------------------------------------------------------------------
>> >
>> > Using Tomcat but need to do more? Need to support web services, security?
>> > Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 
>> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Geoserver-users mailing list
>> > [hidden email]
>> <mailto:[hidden email]>
>> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
>> >
>>
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 
>> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>> _______________________________________________
>> Geoserver-users mailing list
>> [hidden email]
>> <mailto:[hidden email]>
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>>  
>>
>>
>
> !DSPAM:1003,44b3c2a3199991804284693!
>
>
> ------------------------------------------------------------------------
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
> !DSPAM:1003,44b3c2a3199991804284693!
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
> !DSPAM:1003,44b3c2a3199991804284693!
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

cholmes.vcf (281 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: projection/datum - SLD

Randy George
Hi,

Chris wrote:
> the sld wizard is very basic as you'll see.  You can
>access it by going to Config -> Data -> Feature Type -> Edit (I think)
>and there should be a link to 'create new SLD' there.

        Are there any docs on this? I am having trouble determining how it
works. If I edit a FeatureType and click on 'Create newSLD' a new page pops
up showing:
"* All fields are required."

When I hit the 'Apply Style' button I get an sld template in the text box:
        .
        .
Making sld for: parcelSLD:
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
        xmlns:gml="http://www.opengis.net/gml"
        xmlns:ogc="http://www.opengis.net/ogc"
        xmlns="http://www.opengis.net/sld">
        <NamedLayer>
                <Name>parcel</Name>
                <UserStyle>
                        <Name>parcel_style</Name>
                        <Title>geoserver style</Title>
                        <Abstract>Generated by GeoServer</Abstract>
                        <FeatureTypeStyle>
                        <Rule>
                        </Rule>
                        </FeatureTypeStyle>
                </UserStyle>
        </NamedLayer>
</StyledLayerDescriptor>
Saving stylegetXML through IE
waiting for response...
waiting for response...
waiting for response...
waiting for response...
waiting for response...

Finish returns to the FeatureType Edit but I don't see where the parcelSLD
file is created/written? Of course I would need to fill in the <Rule> but I
am wondering what this does actually?

Thanks
Randy

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Chris
Holmes
Sent: Tuesday, July 11, 2006 9:56 AM
To: Gérald Estadieu
Cc: [hidden email]
Subject: Re: [Geoserver-users] projection/datum - SLD



Gérald Estadieu wrote:
> Hi Randy,
>
> thanks again for your answer. You were right! I made a mistake in the
> proj4 column in the spatial_ref_sys. Everything is ok now, althought I
> have now to create a Mapbuilder custom apps. Moreover I had a problem
> with my SLDs. I generated them in uDig but geoserver does not work well
> with them although it validated them. When I created new one based on
> the default one in geoserver it all works fine. Is there any bug?
Not sure, what's the behavior you're getting?  I can try to do the same
and see, it is supposed to be working, and indeed we use the same code
as uDig.

>
> Beside I am doing simple SLDs for "standard" basemap information such as
> land, water, streets, park, buildings based on color from Google Maps,
> is there any interest to include them in standard in GeoServer to give
> nicer examples of map out-of-the-box. Of course I understand that for
> highways/avenues/streets in Google Maps it really depends on the data
> model but it is pretty easy to have a basic set that can fit most usual
> cases.
Oh oh!  Yes please, I was actually really hoping to do this very soon
myself.  Are you doing it off of tiger data?  Or some other data set?
If not tiger I'm happy to adapt it.  We're planning on standing up a
server for all of tiger data, see:
http://geo.openplans.org/cholmes/ol-cache.html for what we've got so
far.  I'd love to have a gmaps look alike interface for it.  We're
hoping eventually to have the ability for users to actually interact
with the data model, modify the road attributes so that 'major roads'
are styled better.  So start with tiger and hopefully get it closer to
the quality of gmaps.  A good place to post them would be at:
http://docs.codehaus.org/display/GEOSDOC/SLD+Snippets

> I did not find a way to test the SLD wizard in GeoServer 1.3.2 (how can
> I access to it?) so maybe what I proposed is useless already!!!
We wish ;)  No, the sld wizard is very basic as you'll see.  You can
access it by going to Config -> Data -> Feature Type -> Edit (I think)
and there should be a link to 'create new SLD' there.

best regards,

Chris

>
> Gerald
>
>
>
> On Jul 8, 2006, at 5:33 AM, Randy George wrote:
>
>> Hi Gerald,
>>
>>  
>>
>> > It does input my 3 polygons inside the new table with lat around 22
>> and long 0.xxx. Is it normal for the long?
>> No, that doesn’t sound right -  longitude should be somewhere around
>> 113º 32' 11'' E.  Latitude sounds right for lat origin 22º 12' 44'' N.
>> Something apparently isn’t correct on the spatial_ref_sys entry or the
>> data is a long way from the transverse mercator meridian. Check over
>> the spatial_ref_sys again. Its easy to make a mistake.
>>
>>  
>>
>> Also it sounds like from the way you are creating ‘basemap_land’ that
>> you may not have an entry in the PostGIS geometry_columns table. If I
>> recall correctly GeoServer will not find the geometry column when
>> attempting to create a feature type unless there is a record in the
>> geometry_columns table
>>
>>  
>>
>> You can do this manually with an insert similar to this:
>>
>> INSERT INTO geometry_columns (f_table_catalog, f_table_schema,
>> f_table_name, f_geometry_column, coord_dimension, srid, "type") VALUES
>> ('', 'public', 'table', 'the_geom', 2, 104309, 'LINESTRING');
>>
>>  
>>
>> Or better approach, use the PostGIS AddGeometryColumn function similar
>> to this:
>>
>> select
AddGeometryColumn('DB',’table','the_geom','104309','LINESTRING',2);

>>
>>  
>>
>> syntax found here http://postgis.refractions.net/docs/ch04.html#id2523380
>>
>>     * AddGeometryColumn(<schema_name>, <table_name>,
>>     *             <column_name>, <srid>, <type>, <dimension>)
>>
>>  
>>
>> Randy George
>>
>>  
>>
>> ------------------------------------------------------------------------
>>
>> *From:* [hidden email]
>> [mailto:[hidden email]] *On Behalf Of
>> *Gerald Estadieu
>> *Sent:* Friday, July 07, 2006 12:39 PM
>> *To:* Randy George; [hidden email]
>> <mailto:[hidden email]>
>> *Subject:* Re: [Geoserver-users] newbie on projection/datum
>>
>>  
>>
>> Hi Randy,
>>
>> thanks for this very details information, that's what I needed to
>> understand.
>> Here is what I have done so far:
>> - insert my SRS into Geoserver gt2-epsg.jar and it appears on the list
>> in the web admin. When I connect to postgis and input it, it shows me
>> long/lat around 113 and 22 which are corresponding to the positionning
>> of Macao.
>> - insert the SRS into my database in spatial_ref_sys (btw I could not
>> find in the list the one you mention 104106 from ESRI, is it normal?).
>> Until now, my geom column was in SRID=-1, so I change it to the new
>> one 104309 (sometimes does not work due to some 'violation' by some
>> row, I have to investigate on this probably).
>> I tried to create a similar table with srid 4326 and do an:
>>
>> insert into basemap_land select
>> gid,entity,layer,"level",elevation,color,Transform(the_geom,4326) from
>> land_2005;
>>
>> It does input my 3 polygons inside the new table with lat around 22
>> and long 0.xxx. Is it normal for the long?
>> Moreover when I try to make it as a feature type in geoserver, it
>> cannot detect the srs and if I put 4326 it keeps telling me
>>
>> 'The FeatureType 'basemap_land' has a NULL extent.
>> HINT: the dataset is empty or has no default geometry attribute.'
>>
>> The dataset is not empty and there is one geometry column. Is it
>> because the CRS is not correct and so the transform is not working well?
>>
>> here is the SQL I use to create my new table (based on the existing one):
>> CREATE TABLE basemap_land
>> (
>>   gid serial NOT NULL,
>>   entity varchar(14),
>>   layer varchar(32),
>>   "level" int8,
>>   elevation float8,
>>   color int4,
>>   the_geom geometry,
>>   CONSTRAINT basemap_land_pkey PRIMARY KEY (gid),
>>   CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
>>   CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
>> 'MULTIPOLYGON'::text OR the_geom IS NULL),
>>   CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326)
>> )
>> WITH OIDS;
>> ALTER TABLE basemap_land OWNER TO postgres;
>>
>>
>> For information I use geoserver 1.3.2 (btw, I read there is a sld
>> wizard but no where there is a link to access it...unless I am nuts).
>>
>> I can see I am getting close to the stage where it can works...hope
>> someone can help me again to understand this area where I am really a
>> newbie, still.
>> Thanks
>>
>> Gerald
>>
>> On 7/6/06, *Randy George* <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>
>> Hi Gerald,
>>
>>         One further caveat, if you are planning to use the WFS service as
>> well as the WMS you will probably want to just convert your geometry
>> to SRS
>> 4326. The re-projection capability of WFS is evidently defined at OGC
>> (WFS1.1) and plans to implement in GeoServer appear to be down the road
>> slightly with 1.4.?
>>
>> I.      If you want GeoServer WMS to recognize your CRS you will need
>> to add
>> some information to GeoServer since I don't think this is a common EPSG.
>>
>> You would need to modify the gt2-epsg.jar adding a new custom CRS
>> definition
>> to the end of the \org\geotools\referencing\crs\epsg.properties file.
>>
>> For example substituting your Macau Special Administration parameters and
>> making use of the existing EPSG Datum 104106:
>>
>> 104309=PROJCS["Macau Special Admin",
>>
GEOGCS["GCS_Datum_Lisboa_Hayford",DATUM["D_Datum_Lisboa_Hayford",SPHEROID["I
>> nternational_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree",
>> 0.01745
>> 3292519943295],AUTHORITY["ESRI","104106"]]
>>
,PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",22.212222]
>> ,PARAMETER["central_meridian",113.536389
>> ],PARAMETER["scale_factor",1.0],PARA
>>
METER["false_easting",20000],PARAMETER["false_northing",20000],UNIT["metre",

>> 1,AUTHORITY["EPSG","9001"]],AUTHORITY["Macau Special Admin","104309"]]
>>
>> (Note that I didn't check this against real data)
>>
>>
>> II. If you want both WMS and WFS to serve your data source you should
>> transform your datastore geometry to 4326 (or wait for 1.4.? release).
>>
>>         If you have a coord transform package with your CRS you could
>> just
>> change from the Macau CRS to 4326. Another way to do this if you have
>> PostGIS is to add a new record to the spatial_ref_sys of your database.
>>         Looking at the Macau Special Administration parameters you
>> listed, I
>> think you could take 'ESRI 102160' from the modified spatial_ref_sys
table

>> of PostGIS and modify it with your origin and false easting,northing.
>>
>>    Latitude of Origin    :    22º 12' 44'' N = 22.212222
>>    Longitude of Origin    :    113º 32' 11'' E = 113.536389
>>    False Easting        :    20,000.000 m (meters) [X=x+20,000.000 m]
>>    False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
>>
>> For example changing from 102160 ESRI in the PostGIS spatial_ref_sys
>> table
>> you would have something like this:
>>
>> INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext,
>> proj4text)
>> VALUES (104309, 'Macau Special Admin', 104309,
>>
'PROJCS["Datum_73_Hayford_Gauss_IGeoE",GEOGCS["GCS_Datum_73",DATUM["D_Datum_

>>
>>
73",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["
>>
Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["
>> False_Easting",
>> 20000.0],PARAMETER["False_Northing",20000.0],PARAMETER["Centr
>>
al_Meridian",113.536389],PARAMETER["Scale_Factor",1],PARAMETER["Latitude_Of_

>> Origin",39.66666666666666],UNIT["Meter",1]]', '+proj=tmerc +lat_0=
>> 22.212222
>> +lon_0=113.536389 +k=1.000000 +x_0=20000.0 +y_0=20000.0 +ellps=intl
>> +units=m');
>>
>> Once you have your CRS defined in the spatial_ref_sys you should be
>> able to
>> get the transformed coordinates like this:
>>
>> SELECT asewkt(transform(the_geom),4326) from your_table;
>>
>> I hope this helps more than hinders, but when you have a non standard
>> coordinate system it does take some playing around to get things to
>> work. I
>> know this from recent experience and Chris Holmes helpfully pointed
>> out that
>> the WFS re-projection is a future feature.
>>
>> Thanks
>> Randy George
>> www.cadmaps.com <http://www.cadmaps.com>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: [hidden email]
>> <mailto:[hidden email]>
>> [mailto: [hidden email]
>> <mailto:[hidden email]>] On Behalf Of
Brent

>> Owens
>> Sent: Tuesday, July 04, 2006 9:23 AM
>> To: Gerald Estadieu
>> Cc: [hidden email]
>> <mailto:[hidden email]>
>> Subject: Re: [Geoserver-users] newbie on projection/datum
>>
>> You should always tell geoserver what projection your data is in, even
>> if it is the regular 4326 lat/lon projection. The data in the database
>> should also be in the same projection and you should specify that in
>> postgis.
>> When a request comes in from mapbuilder or udig, a "requested" SRS value
>> is sent. Geoserver will look at that value, then look at the SRS of the
>> data. If they are different, it will reproject the data for you into the
>> "requested" projection.
>>
>> Brent Owens
>> (The Open Planning Project)
>>
>>
>>
>> Gerald Estadieu wrote:
>> > Hi all,
>> >
>> > I know it is not the first time someone ask this kind of question but
>> > I still need some clarification from some experts here. I have a
>> > dataset from Macao to setup a demo on PostGIS/Geoserver +
>> > mapBuilder/uDig as a feasibility study. I got the all thing in
>> > shapefiles without any .prj file but I got a document with the
following:

>> >
>> > ======================================================
>> > Coordinates
>> >
>> > Projection of Special Administrative Region of Macau
>> >
>> > Transverse Mercator Projection.
>> >
>> > Ellipsoid:
>> >
>> > ·    International Hayford (a = 6,378, 388.000 m, 1/f =
297.00000000000)

>> > ·    WGS-84 (World Geodetic System 1984) (a = 6,378,137.000 m, 1/f =
>> > 298.25722357000)
>> >
>> >
>> > Origin
>> >
>> > The following "datum" has been taken as the origin of the network for
>> > Special Administrative Region of Macau:
>> >
>> > Longitude: 113º 32' 11'' E
>> > Latitude: 22º 12' 44'' N
>> >
>> > and the following as the corresponding rectangular coordinates:
>> >
>> > 20 000.000 m N and 20 000.000 m E
>> >
>> >
>> > Projection parameters
>> >
>> > International Hayford
>> >
>> > Reference Ellipsoid    :    a (Major semi-axis) = 6,378,388.000 m
>> > f (Flattening) = 1/297
>> > Projection        :    Transverse Mercator Projection
>> > Latitude of Origin    :    22º 12' 44'' N
>> > Longitude of Origin    :    113º 32' 11'' E
>> > False Easting        :    20,000.000 m (meters) [X=x+20, 000.000 m]
>> > False Northing        :    20,000.000 m (meters) [Y=y+20,000.000 m]
>> > Datum Level        :    Mean Sea Level
>> > Scale Factor        :    1
>> > ====================================================
>> >
>> > I imported all feature type in PostGIS but my SRID is -1 so far (which
>> > is normal since I did not specify anything). I can access my data in
>> > uDig/qGIS no problem when I use directly PostGIS but not when I use
>> > GeoServer with mapbuilder (probably due to the missing CRS). In
>> > Geoserver I declared my feature type in EPSG:4326 and everything has
>> > been accepted and validated by GeoServer.
>> > Here are a few questions I have to understand how to make the all
>> > things properly in PostGIS and GeoServer
>> > - Should I insert the CRS in PostGIS/Geoserver as defined above or it
>> > is better to make a kind of "translation" in my data through some SQL
>> > code to make it fit in the 4326 system?
>> > - based on the above CRS definition how can I write it in the EPSG
>> > format? I am not sure I understand how it is written. I believe I have
>> > everything to do it but how? Good question!!! Again isn't it easier to
>> > "translate" my data (since I can see that I have a North and East
>> > translation). (something like GEOGCS["WGS 84", DATUM["WGS_1984",
>> > SPHEROID["WGS 84", 6378137.0 , 298.257223563,
>> > AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]],
>> > PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree",
>> > 0.017453292519943295], AXIS["Lon", EAST], AXIS["Lat", NORTH],
>> > AUTHORITY["EPSG","4326"]])
>> >
>> > I would appreciate some lights on my missing knowledge on this area!
>> >
>> > Gerald
>> >
------------------------------------------------------------------------
>> >
>> > Using Tomcat but need to do more? Need to support web services,
security?
>> > Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> >
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 
>>
<http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>> >
------------------------------------------------------------------------

>> >
>> > _______________________________________________
>> > Geoserver-users mailing list
>> > [hidden email]
>> <mailto:[hidden email]>
>> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
>> >
>>
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 
>>
<http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>

>> _______________________________________________
>> Geoserver-users mailing list
>> [hidden email]
>> <mailto:[hidden email]>
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>>  
>>
>>
>
> !DSPAM:1003,44b3c2a3199991804284693!
>
>
> ------------------------------------------------------------------------
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier

> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
>
> !DSPAM:1003,44b3c2a3199991804284693!
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
> !DSPAM:1003,44b3c2a3199991804284693!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users