Re: [mapserver-users] PostGIS data in EPSG:31300 using for Google Maps overlay
Hi Steven, Just to add some thoughts: As Brent suggests, both postgis and mapserver can reproject. What you are doing now is let postgis (or actually the proj-library that's doing the hardwork for the transform(..)-function). But mapserver is also able to do the 'on the fly' projection (and also using a proj-lib for that). Difference for this two methods is that if you let mapserver do it, then you can use wms-service (one mapfile with one layer definition) be used for several different projection requests. So using brents example, you can do: METADATA "wms_title" "My WMS Server" "wms_srs" "EPSG:4326 EPSG:28992 EPSG:900913 EPSG 31300" END and mapserver has to know the 'native' projection as brent said: LAYER ... PROJECTION "init=epsg:31300" END ... END In this way mapserver's proj is doing the heavy lifting and you can use different clients using different projections to connect to the same wms service. The tricky stuff here is to know which proj (or actually which epsg file) is used for which library/component. For example postgis has it's proj parameters in a table 'spatial_ref_sys', so when you want to use a exotic projection you have to add it here. But if you want to use this exotic projection for mapserver/ms4w, you have to add it to: C:\ms4w\proj\nad\epsg Groet Richard Duivenvoorde Steven De Vriendt wrote: Brent, Maybe quite a basic question, but I'm not used to define my data syntax as the one you propose. Can you help me out with the declaration. I'm quite confused what to fill in for gid Do I leave it like it is and just write gid or doi I have or do I have to define my primary key column (f.i.: tbl_b_cabu_pkey). For both I get an error message, saying either column OID does not exist or column tbl_b_cabu_pkey does not exist. However there are both there... DATA "new_geom from (select gid, transform(the_geom,4326) as new_geom from table) as mytable using unique gid using srid=4326" Thanks for helping out ! On Tue, Apr 8, 2008 at 8:25 PM, Steven De Vriendt <[EMAIL PROTECTED]> wrote: Brent, Very, very usefull info. Thanks. I was just about to reprojecting my data :-) I thought the SRID table was "constrained" to the geometry and you couldn't change it. Seems like that's why the 'virtual' table is there for. Ok, well, I'll give it a try. Thanks for your input ! Regards, Steven On Tue, Apr 8, 2008 at 7:58 PM, Brent Wood <[EMAIL PROTECTED]> wrote: > > --- Steven De Vriendt <[EMAIL PROTECTED]> wrote: > > > Hi list, > > > > I have some data in PostGIS I wish to overlay in Google Maps using WMS > > I'm using the same data in a mapserver application, where EPSG code > > 31300 is used. > > Now for overlay in Google Maps, 4326 is required. > > I have made a copy of my map-file and specified 4326 as projection > > system.Yet, non of my data is showing up. > > > > Do I need to reproject my data for this use ? I thought PostGIS was > > capable of doing reprojection on the fly ? > > Hi Steven, > > Both mapserver & POstGIS can reproject the data on the fly, but they need to be > told the input & output projections. > > As your data is all displayed via mapserver, the instructions either way will > be in your mapfile. > > To reproject using PostGIS, edit the SQL command in your data statement which > retrieves the PostGIS data. You need to tell PostGIS to return a virtual table > to mapserver, and transform the data to the required projection in this. Edit > the data line in the layer something like this: > > DATA "new_geom from (select gid, transform(the_geom,4326) as new_geom from > table) as mytable using unique gid using srid=4326" > > > To reproject in mapserver, you need to set the main mapfile projection to > EPSG:4326, using, in the global header part of the mapfile: > > UNITS DD > PROJECTION > "init=epsg:4326" > END > > In the METADATA section, you'll need to set the output projection for WMS, eg: > METADATA > "wms_title" "My WMS Server" > "wms_srs" "EPSG:4326" > END > > Then in the layer definition, you specify the layer's native projection, so > mapserver can reproject from one to the other: > > LAYER > ... > PROJECTION > "init=epsg:31300" > END > ... > END > > Note that to reproject in PostGIS, Proj.4 support must be compiled into > PostGIS, and similarly for mapserver if you do the reprojection there. If you > compiled these from source, this is not done by default, & you'll need to run > configure with the appropriate flag. If you installed from a package, or on > Windows, proj support is generally built in. > > > HTH, > > Brent Wood > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lis
Re: [MAPSERVER-USERS] PostGIS data in EPSG:31300 using for Google Maps overlay
thanks Carla, although I'm not sure about that last bit. So I have searched for the epsg parameters of 31300 (Belge Lambert 72), and now I have to add some parameters ? I'm not sure which parameters I have to add/adjust.. <31300> +proj=lcc +lat_1=49.84 +lat_2=51.16 +lat_0=90 +lon_0=4.3569397 +x_0=15.01256 +y_0=5400088.4378 +ellps=intl +units=m +no_defs no_defs <> Thanks Steven On Wed, Apr 9, 2008 at 9:04 AM, cfb <[EMAIL PROTECTED]> wrote: > > Hi Steven, > > I had the same problems, my data were in EPSG:23030 but when I wanted to > overlay my WMS in Google Earth, even If I'd included EPSG:4326 in the > wms_srs list, It showed a difference between my map and Google. So, first of > all, you must include the 4326 in your wms_srs list (in the header and in > the layers), then you must set EPSG:4326 as your projection object in the > header, leaving the layers projections as 31300, and then you must look at > the epsg file in the PROJ library (\\ms4w\proj\nad), because probably your > EPSG code (31300) asn't all the parameters needed to reproject correctly the > data... > > Look something like +towgs84, and try to find some parameter that help > MapServer to reproject better the data...like this you won't have to > reproject your original data > > Regards > > > > > > > > > > gisaalter wrote: > > > > Hi list, > > > > I have some data in PostGIS I wish to overlay in Google Maps using WMS > > I'm using the same data in a mapserver application, where EPSG code > > 31300 is used. > > Now for overlay in Google Maps, 4326 is required. > > I have made a copy of my map-file and specified 4326 as projection > > system.Yet, non of my data is showing up. > > > > Do I need to reproject my data for this use ? I thought PostGIS was > > capable of doing reprojection on the fly ? > > > > Can someone with some more experience help me out ? > > > > Thanks > > Steven > > > ___ > > mapserver-users mailing list > > mapserver-users@lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > > > -- > View this message in context: > http://www.nabble.com/PostGIS-data-in-EPSG%3A31300-using-for-Google-Maps-overlay-tp16562400p16580808.html > Sent from the Mapserver - User mailing list archive at Nabble.com. > > > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [MAPSERVER-USERS] PostGIS data in EPSG:31300 using for Google Maps overlay
Hi Steven, I had the same problems, my data were in EPSG:23030 but when I wanted to overlay my WMS in Google Earth, even If I'd included EPSG:4326 in the wms_srs list, It showed a difference between my map and Google. So, first of all, you must include the 4326 in your wms_srs list (in the header and in the layers), then you must set EPSG:4326 as your projection object in the header, leaving the layers projections as 31300, and then you must look at the epsg file in the PROJ library (\\ms4w\proj\nad), because probably your EPSG code (31300) asn't all the parameters needed to reproject correctly the data... Look something like +towgs84, and try to find some parameter that help MapServer to reproject better the data...like this you won't have to reproject your original data Regards gisaalter wrote: > > Hi list, > > I have some data in PostGIS I wish to overlay in Google Maps using WMS > I'm using the same data in a mapserver application, where EPSG code > 31300 is used. > Now for overlay in Google Maps, 4326 is required. > I have made a copy of my map-file and specified 4326 as projection > system.Yet, non of my data is showing up. > > Do I need to reproject my data for this use ? I thought PostGIS was > capable of doing reprojection on the fly ? > > Can someone with some more experience help me out ? > > Thanks > Steven > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > -- View this message in context: http://www.nabble.com/PostGIS-data-in-EPSG%3A31300-using-for-Google-Maps-overlay-tp16562400p16580808.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PostGIS data in EPSG:31300 using for Google Maps overlay
Brent, Maybe quite a basic question, but I'm not used to define my data syntax as the one you propose. Can you help me out with the declaration. I'm quite confused what to fill in for gid Do I leave it like it is and just write gid or doi I have or do I have to define my primary key column (f.i.: tbl_b_cabu_pkey). For both I get an error message, saying either column OID does not exist or column tbl_b_cabu_pkey does not exist. However there are both there... DATA "new_geom from (select gid, transform(the_geom,4326) as new_geom from table) as mytable using unique gid using srid=4326" Thanks for helping out ! On Tue, Apr 8, 2008 at 8:25 PM, Steven De Vriendt <[EMAIL PROTECTED]> wrote: > Brent, > > Very, very usefull info. Thanks. I was just about to reprojecting my data > :-) > I thought the SRID table was "constrained" to the geometry and you couldn't > change it. Seems like that's why the 'virtual' table is there for. Ok, > well, I'll give > it a try. Thanks for your input ! > > Regards, > Steven > > > > On Tue, Apr 8, 2008 at 7:58 PM, Brent Wood <[EMAIL PROTECTED]> wrote: > > > > --- Steven De Vriendt <[EMAIL PROTECTED]> wrote: > > > > > Hi list, > > > > > > I have some data in PostGIS I wish to overlay in Google Maps using WMS > > > I'm using the same data in a mapserver application, where EPSG code > > > 31300 is used. > > > Now for overlay in Google Maps, 4326 is required. > > > I have made a copy of my map-file and specified 4326 as projection > > > system.Yet, non of my data is showing up. > > > > > > Do I need to reproject my data for this use ? I thought PostGIS was > > > capable of doing reprojection on the fly ? > > > > Hi Steven, > > > > Both mapserver & POstGIS can reproject the data on the fly, but they need > to be > > told the input & output projections. > > > > As your data is all displayed via mapserver, the instructions either way > will > > be in your mapfile. > > > > To reproject using PostGIS, edit the SQL command in your data statement > which > > retrieves the PostGIS data. You need to tell PostGIS to return a virtual > table > > to mapserver, and transform the data to the required projection in this. > Edit > > the data line in the layer something like this: > > > > DATA "new_geom from (select gid, transform(the_geom,4326) as new_geom from > > table) as mytable using unique gid using srid=4326" > > > > > > To reproject in mapserver, you need to set the main mapfile projection to > > EPSG:4326, using, in the global header part of the mapfile: > > > > UNITS DD > > PROJECTION > > "init=epsg:4326" > > END > > > > In the METADATA section, you'll need to set the output projection for > WMS, eg: > > METADATA > > "wms_title" "My WMS Server" > > "wms_srs" "EPSG:4326" > > END > > > > Then in the layer definition, you specify the layer's native projection, > so > > mapserver can reproject from one to the other: > > > > LAYER > > ... > > PROJECTION > > "init=epsg:31300" > > END > > ... > > END > > > > Note that to reproject in PostGIS, Proj.4 support must be compiled into > > PostGIS, and similarly for mapserver if you do the reprojection there. If > you > > compiled these from source, this is not done by default, & you'll need to > run > > configure with the appropriate flag. If you installed from a package, or > on > > Windows, proj support is generally built in. > > > > > > HTH, > > > > Brent Wood > > > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PostGIS data in EPSG:31300 using for Google Maps overlay
Brent, Very, very usefull info. Thanks. I was just about to reprojecting my data :-) I thought the SRID table was "constrained" to the geometry and you couldn't change it. Seems like that's why the 'virtual' table is there for. Ok, well, I'll give it a try. Thanks for your input ! Regards, Steven On Tue, Apr 8, 2008 at 7:58 PM, Brent Wood <[EMAIL PROTECTED]> wrote: > > --- Steven De Vriendt <[EMAIL PROTECTED]> wrote: > > > Hi list, > > > > I have some data in PostGIS I wish to overlay in Google Maps using WMS > > I'm using the same data in a mapserver application, where EPSG code > > 31300 is used. > > Now for overlay in Google Maps, 4326 is required. > > I have made a copy of my map-file and specified 4326 as projection > > system.Yet, non of my data is showing up. > > > > Do I need to reproject my data for this use ? I thought PostGIS was > > capable of doing reprojection on the fly ? > > Hi Steven, > > Both mapserver & POstGIS can reproject the data on the fly, but they need to > be > told the input & output projections. > > As your data is all displayed via mapserver, the instructions either way will > be in your mapfile. > > To reproject using PostGIS, edit the SQL command in your data statement which > retrieves the PostGIS data. You need to tell PostGIS to return a virtual > table > to mapserver, and transform the data to the required projection in this. Edit > the data line in the layer something like this: > > DATA "new_geom from (select gid, transform(the_geom,4326) as new_geom from > table) as mytable using unique gid using srid=4326" > > > To reproject in mapserver, you need to set the main mapfile projection to > EPSG:4326, using, in the global header part of the mapfile: > > UNITS DD > PROJECTION > "init=epsg:4326" > END > > In the METADATA section, you'll need to set the output projection for WMS, > eg: > METADATA > "wms_title" "My WMS Server" > "wms_srs" "EPSG:4326" > END > > Then in the layer definition, you specify the layer's native projection, so > mapserver can reproject from one to the other: > > LAYER > ... > PROJECTION > "init=epsg:31300" > END > ... > END > > Note that to reproject in PostGIS, Proj.4 support must be compiled into > PostGIS, and similarly for mapserver if you do the reprojection there. If you > compiled these from source, this is not done by default, & you'll need to run > configure with the appropriate flag. If you installed from a package, or on > Windows, proj support is generally built in. > > > HTH, > > Brent Wood > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PostGIS data in EPSG:31300 using for Google Maps overlay
--- Steven De Vriendt <[EMAIL PROTECTED]> wrote: > Hi list, > > I have some data in PostGIS I wish to overlay in Google Maps using WMS > I'm using the same data in a mapserver application, where EPSG code > 31300 is used. > Now for overlay in Google Maps, 4326 is required. > I have made a copy of my map-file and specified 4326 as projection > system.Yet, non of my data is showing up. > > Do I need to reproject my data for this use ? I thought PostGIS was > capable of doing reprojection on the fly ? Hi Steven, Both mapserver & POstGIS can reproject the data on the fly, but they need to be told the input & output projections. As your data is all displayed via mapserver, the instructions either way will be in your mapfile. To reproject using PostGIS, edit the SQL command in your data statement which retrieves the PostGIS data. You need to tell PostGIS to return a virtual table to mapserver, and transform the data to the required projection in this. Edit the data line in the layer something like this: DATA "new_geom from (select gid, transform(the_geom,4326) as new_geom from table) as mytable using unique gid using srid=4326" To reproject in mapserver, you need to set the main mapfile projection to EPSG:4326, using, in the global header part of the mapfile: UNITS DD PROJECTION "init=epsg:4326" END In the METADATA section, you'll need to set the output projection for WMS, eg: METADATA "wms_title" "My WMS Server" "wms_srs" "EPSG:4326" END Then in the layer definition, you specify the layer's native projection, so mapserver can reproject from one to the other: LAYER ... PROJECTION "init=epsg:31300" END ... END Note that to reproject in PostGIS, Proj.4 support must be compiled into PostGIS, and similarly for mapserver if you do the reprojection there. If you compiled these from source, this is not done by default, & you'll need to run configure with the appropriate flag. If you installed from a package, or on Windows, proj support is generally built in. HTH, Brent Wood ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] PostGIS data in EPSG:31300 using for Google Maps overlay
Hi list, I have some data in PostGIS I wish to overlay in Google Maps using WMS I'm using the same data in a mapserver application, where EPSG code 31300 is used. Now for overlay in Google Maps, 4326 is required. I have made a copy of my map-file and specified 4326 as projection system.Yet, non of my data is showing up. Do I need to reproject my data for this use ? I thought PostGIS was capable of doing reprojection on the fly ? Can someone with some more experience help me out ? Thanks Steven ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users