Re: [mapserver-users] PostGIS query problem

2020-06-25 Thread Jeff McKenna

Hi Fernando,

I would try using the shp2img utility at the commandline, and set CONFIG 
"CPL_DEBUG" "ON" in your mapfile (see 
https://mapserver.org/optimization/debugging.html#step-3-turn-on-cpl-debug-optional) 
and then execute:


  shp2img -m mymap.map -o ttt.png -all_debug 5

The full query should be listed there in the response, which you can 
then paste into the psql commandline, and manually execute the same 
query to your database.


PS. hello to my friends in Brasil!

-jeff



--
Jeff McKenna
MapServer Consulting and Training Services
co-founder of FOSS4G
http://gatewaygeo.com/


On 2020-06-25 5:16 p.m., Fernando Martins Pimenta wrote:

Hi,

I am using the query below to return a hydrograph of a region (using 
POSTGIS). This query works perfectly when I use it in pgadmin. With the 
mapserver, the connection with the client is lost. It records a query 
that shows no errors in SQL, just shows that the connection has lost. 
Why is that?


DATA "geom FROM (
          SELECT
             hidro.fid, hidro.name , 
ST_Intersection(gcc.geom, hidro.geom) AS geom

           FROM
             vector.hidrography AS hidro,
             vector.gcc AS gcc
           WHERE ST_Intersects(gcc.geom, hidro.geom) AND gcc.name 
 = 'GRANDE'

) as subquery USING UNIQUE fid USING SRID=4326"

Thanks in advance

*Fernando Martins Pimenta *
Graduando em Engenharia de Agrimensura e Cartográfica - UFV
Bacharel em Engenharia de Biossistemas - UFSJ

www.biosfera.dea.ufv.br 




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

Re: [mapserver-users] PostGIS query problem

2020-06-25 Thread Seth G
Hi,

What client are you using?
How long does the query take to complete?
It is likely the client stops waiting for a response.

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Thu, Jun 25, 2020, at 10:16 PM, Fernando Martins Pimenta wrote:
> Hi,
> 
> I am using the query below to return a hydrograph of a region (using 
> POSTGIS). This query works perfectly when I use it in pgadmin. With the 
> mapserver, the connection with the client is lost. It records a query that 
> shows no errors in SQL, just shows that the connection has lost. Why is that?
> 
> DATA "geom FROM (
>  SELECT
>  hidro.fid, hidro.name, ST_Intersection(gcc.geom, hidro.geom) AS geom
>  FROM
>  vector.hidrography AS hidro, 
>  vector.gcc AS gcc
>  WHERE ST_Intersects(gcc.geom, hidro.geom) AND gcc.name = 'GRANDE' 
>  ) as subquery USING UNIQUE fid USING SRID=4326"
> 
> Thanks in advance
> 
> *Fernando Martins Pimenta *
> Graduando em Engenharia de Agrimensura e Cartográfica - UFV
> Bacharel em Engenharia de Biossistemas - UFSJ
> 
> www.biosfera.dea.ufv.br
> 
> ___
> 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

[mapserver-users] PostGIS query problem

2020-06-25 Thread Fernando Martins Pimenta
Hi,

I am using the query below to return a hydrograph of a region (using
POSTGIS). This query works perfectly when I use it in pgadmin. With the
mapserver, the connection with the client is lost. It records a query that
shows no errors in SQL, just shows that the connection has lost. Why is
that?

DATA "geom FROM (
 SELECT
hidro.fid, hidro.name, ST_Intersection(gcc.geom, hidro.geom) AS
geom
  FROM
vector.hidrography AS hidro,
vector.gcc AS gcc
  WHERE ST_Intersects(gcc.geom, hidro.geom) AND gcc.name = 'GRANDE'
) as subquery USING UNIQUE fid USING SRID=4326"

Thanks in advance

*Fernando Martins Pimenta *
Graduando em Engenharia de Agrimensura e Cartográfica - UFV
Bacharel em Engenharia de Biossistemas - UFSJ

www.biosfera.dea.ufv.br
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Differerent output format for GetFeatureInfo - template strategy

2020-06-25 Thread Seth G
Hi,

I'm not sure if you have a custom template for each layer already, or if this 
something you want to avoid?

I'm guessing ideally you want to be able to change the LAYER - TEMPLATE via the 
URL?
Although this is not listed in the docs at 
https://mapserver.org/cgi/runsub.html#parameters-supported looking at the 
source I think it can be replaced via a URL. 

You can also set a CLASS TEMPLATE via the URL, and maybe have a different CLASS 
for each INFO_FORMAT and select it with GetStyles. 

Changing the format filename for each layer might be a possibility?
https://mapserver.org/cgi/runsub.html#parameters-supported
OUTPUTFORMAT: FORMATOPTION: FILENAME (must have a MAP VALIDATION pattern)

Seth

--
web:http://geographika.co.uk
twitter: @geographika


On Thu, Jun 25, 2020, at 2:12 PM, jorge.mendesdeje...@isric.org wrote:
> Dear mapserver community
> 
> I am trying to set a WMS where the a GetFeatureInfo will support more than 
> one INFO_FORMAT, currently I have text/html implemented [1], which uses a 
> layer level implementation. This works fine when you have only one format [2].
> 
> Now I need to have 2 formats, html and geojson/json. 
> 
> Documentation is very clear that the best strategy is to use the 
> OUTPUTFORMAT, each output format associated with a specific template, this 
> works fine .
> 
> Problem is that all examples that I see using outputformat have a very clear 
> layer name indication (below is nums)
> 
> // mapserver template
> [resultset layer=mums]
> 
> This simplely doesn't work if you have 100 layers on a mapfile and we need a 
> output format template for all of them, I have search for some generic 
> parameter that could relay the layer name being used but no luck. With 
> setting the layer name it doesn't work!! And arguments can't be replaced 
> 
> Question :
> - How can I have a generic [resultset ] that can be use by multiple 
> layers [3] 
> - Template at layer level works good but I don't think we can support 2 
> formats there, is this correct??? 
> 
> 
> System:
> mapserver7.6.0 gdal2.4 proj4
> 
> 
> Thank you 
> Jorge de Jesus
> 
> [1] 
> https://maps.isric.org/mapserv?map=/map/bdod.map=WMS=1.3.0=GetFeatureInfo=47.130647,8.931116,48.604188,29.54223=EPSG:4326=1073=445=bdod_0-5cm_Q0.5==image/tiff_LAYERS=bdod_0-5cm_Q0.5_FORMAT=text/html=509=359_COUNT=1
> 
> [2] 
> https://gis.stackexchange.com/questions/343901/getfeatureinfo-template-of-mapserver-not-replacing-values
> 
> [3] https://pastebin.com/FdepGTf7
> 
> 
> 
> ISRIC — World Soil Information

> 

> PO Box 353 | 6700 AJ Wageningen

> Droevendaalsesteeg 3 (Building 101) | 6708 PB Wageningen 
> 

> The Netherlands

> Telephone (Secretariat): +31 317 483735

> E-mail: i...@isric.org mailto:soil.is...@wur.nl>

> **
> ___
> 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