Re: [mapserver-users] PostGIS layer projection

2019-07-18 Thread Jeff McKenna
I expanded it even more with initial ogrinfo commands (great way to 
check extents, source projection, etc).  Hope this helps the next person 
google-searching!   Feel free to expand the wiki page with your own notes.


-jeff



On 2019-07-18 9:31 AM, Jeff McKenna wrote:
I expanded the wiki page to include the output of psql's describe "\d" 
for that table.


-jeff



On 2019-07-18 8:37 AM, Jeff McKenna wrote:

Hi Radim,

Here is a working mapfile reprojecting a PostGIS layer: 
https://github.com/mapserver/mapserver/wiki/Reproject-PostGIS-Layer


You ask good questions, that could likely just be tested by checking 
the postgres logs and executing the raw commands from those logs at 
the psql commandline and comparing.


As you go down this path, please do add to that new wiki page with 
your own notes :)


-jeff









--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS layer projection

2019-07-18 Thread Jeff McKenna
I expanded the wiki page to include the output of psql's describe "\d" 
for that table.


-jeff



On 2019-07-18 8:37 AM, Jeff McKenna wrote:

Hi Radim,

Here is a working mapfile reprojecting a PostGIS layer: 
https://github.com/mapserver/mapserver/wiki/Reproject-PostGIS-Layer


You ask good questions, that could likely just be tested by checking the 
postgres logs and executing the raw commands from those logs at the psql 
commandline and comparing.


As you go down this path, please do add to that new wiki page with your 
own notes :)


-jeff






--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS layer projection

2019-07-18 Thread Jeff McKenna

Hi Radim,

Here is a working mapfile reprojecting a PostGIS layer: 
https://github.com/mapserver/mapserver/wiki/Reproject-PostGIS-Layer


You ask good questions, that could likely just be tested by checking the 
postgres logs and executing the raw commands from those logs at the psql 
commandline and comparing.


As you go down this path, please do add to that new wiki page with your 
own notes :)


-jeff



--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/



On 2019-07-18 8:04 AM, Radim Blazek wrote:

Hi Jeff,
thanks, yes I have read that.

But I also read that  "using srid= is optional but improves
performance" so there was a little chance that re-projection could be
done anyway if a different SRID is found on geometry.

If there is no further transformation, what difference "using srid="
does? What happens if SRID is not set on column and there are mixed
geoms' SRIDs.

I mean, where is CRS transformation done if request CRS != layer CRS
!= column CRS? I would expect calling directly PostGIS
ST_Transform(geom, request_srid), which would by pass
LAYER.PROJECTION.

Radim

On Thu, Jul 18, 2019 at 12:31 PM Jeff McKenna
 wrote:


Hi Radim,

Give the Projection document a good read specifically the "Important
Notes" section which I believe answers your questions:
https://mapserver.org/mapfile/projection.html#important-notes

There are no specific driver rules; for something like a PostGIS
connection you should be able to follow the "Important Notes" above.
MapServer will assume that you have configured the driver properly (in
the case of PostGIS, setting the SRID as well, since PostGIS requires
that parameter to do a projection)

-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/



On 2019-07-18 5:59 AM, Radim Blazek wrote:

Hi,
can you please explain how does re-projection of PostGIS layers work?
If there is a POSTGIS layer with DATA without "using srid=" but
PostGIS column has SRID defined, there is constraint for that SRID on
the column and geometries have SRID set, is it necessary to define
PROJECTION for that layer if SRID of the column is different from that
of mapfile?

For example, geometry column has SRID=4326, geometries have SRID set, mapfile:

NAME test
   PROJECTION
   "init=epsg:3857"
   END
   LAYER test
CONNECTIONTYPE postgis
DATA "geo FROM test"
   END
END

if a request comes to render a map in 3857, will be geometries
re-projected correctly from 4326 to 3857?



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS layer projection

2019-07-18 Thread Radim Blazek
Hi Jeff,
thanks, yes I have read that.

But I also read that  "using srid= is optional but improves
performance" so there was a little chance that re-projection could be
done anyway if a different SRID is found on geometry.

If there is no further transformation, what difference "using srid="
does? What happens if SRID is not set on column and there are mixed
geoms' SRIDs.

I mean, where is CRS transformation done if request CRS != layer CRS
!= column CRS? I would expect calling directly PostGIS
ST_Transform(geom, request_srid), which would by pass
LAYER.PROJECTION.

Radim

On Thu, Jul 18, 2019 at 12:31 PM Jeff McKenna
 wrote:
>
> Hi Radim,
>
> Give the Projection document a good read specifically the "Important
> Notes" section which I believe answers your questions:
> https://mapserver.org/mapfile/projection.html#important-notes
>
> There are no specific driver rules; for something like a PostGIS
> connection you should be able to follow the "Important Notes" above.
> MapServer will assume that you have configured the driver properly (in
> the case of PostGIS, setting the SRID as well, since PostGIS requires
> that parameter to do a projection)
>
> -jeff
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> https://gatewaygeomatics.com/
>
>
>
> On 2019-07-18 5:59 AM, Radim Blazek wrote:
> > Hi,
> > can you please explain how does re-projection of PostGIS layers work?
> > If there is a POSTGIS layer with DATA without "using srid=" but
> > PostGIS column has SRID defined, there is constraint for that SRID on
> > the column and geometries have SRID set, is it necessary to define
> > PROJECTION for that layer if SRID of the column is different from that
> > of mapfile?
> >
> > For example, geometry column has SRID=4326, geometries have SRID set, 
> > mapfile:
> >
> > NAME test
> >   PROJECTION
> >   "init=epsg:3857"
> >   END
> >   LAYER test
> >CONNECTIONTYPE postgis
> >DATA "geo FROM test"
> >   END
> > END
> >
> > if a request comes to render a map in 3857, will be geometries
> > re-projected correctly from 4326 to 3857?
> >
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] PostGIS layer projection

2019-07-18 Thread Jeff McKenna

Hi Radim,

Give the Projection document a good read specifically the "Important 
Notes" section which I believe answers your questions: 
https://mapserver.org/mapfile/projection.html#important-notes


There are no specific driver rules; for something like a PostGIS 
connection you should be able to follow the "Important Notes" above. 
MapServer will assume that you have configured the driver properly (in 
the case of PostGIS, setting the SRID as well, since PostGIS requires 
that parameter to do a projection)


-jeff


--
Jeff McKenna
MapServer Consulting and Training Services
https://gatewaygeomatics.com/



On 2019-07-18 5:59 AM, Radim Blazek wrote:

Hi,
can you please explain how does re-projection of PostGIS layers work?
If there is a POSTGIS layer with DATA without "using srid=" but
PostGIS column has SRID defined, there is constraint for that SRID on
the column and geometries have SRID set, is it necessary to define
PROJECTION for that layer if SRID of the column is different from that
of mapfile?

For example, geometry column has SRID=4326, geometries have SRID set, mapfile:

NAME test
  PROJECTION
  "init=epsg:3857"
  END
  LAYER test
   CONNECTIONTYPE postgis
   DATA "geo FROM test"
  END
END

if a request comes to render a map in 3857, will be geometries
re-projected correctly from 4326 to 3857?


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users