[mapserver-users] External WMS issue

2022-06-08 Thread John Huotari via MapServer-users
I'm having trouble hitting a WMS referenced from within my .map file.  Instead 
of the image from the WMS being drawn as a layer in my map, I instead get an 
error logged of "request failed with curl error code 60 (SSL certificate 
problem: unable to get local issuer certificate) for 
https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?LAYERS=0&REQUEST=GetMap&SERVICE=WMS&;..."

The confusing thing to me is that the exact same .map file works just fine to 
produce a map image containing the referenced layer when I run mapserver -nh at 
a command prompt.  i.e. mapserv -nh "QUERY_STRING=map=test.map&..." > test.png

I've configured a CURL_CA_BUNDLE environment variable pointing to a 
curl-ca-bundle.crt file and I think the fact that I can reach that external WMS 
when running the mapserv command at a command prompt would indicate it's 
configured correctly.  Any thoughts on what could cause the failure I'm seeing 
though MapServer running on Windows though IIS as a FastCGI app while 
succeeding when running the same .map file at a command prompt?  Or any 
thoughts on what I might try to troubleshoot further?

.map file contents are below

MAP
  NAME "MAP"
  CONFIG "MS_ERRORFILE" "e:/LogFiles/ms_error3.txt"
  CONFIG "PROJ_LIB" "E:/ms/projlib/"
  DEBUG 5
  EXTENT -20037508.342789244 -20037508.342789244 20037508.342789244 
20037508.342789244
  SIZE 256 256
  SYMBOLSET "E:\ms\basedata\symbols.txt"
  FONTSET "E:\ms\basedata\fonts.txt"
  IMAGECOLOR 255 255 255
  TRANSPARENT ON
  DEFRESOLUTION 72
  RESOLUTION 72
  UNITS meters
  PROJECTION "init=epsg:3857" END
  WEB
METADATA
  "wms_enable_request" "*"
END
  END
  LAYER
STATUS DEFAULT TYPE RASTER NAME "WMS_DRG"
DEBUG 5
CONNECTIONTYPE WMS CONNECTION 
"https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?";
PROJECTION "init=epsg:3857" END
METADATA
  "wms_srs"  "EPSG:3857"
  "wms_name"  "0"
  "wms_server_version"  "1.1.1"
  "wms_format"  "image/png"
END
  END
END

*** PLEASE NOTE ***
This message, along with any attachments, is for the designated recipient(s) 
only and may contain privileged, proprietary, or otherwise confidential 
information. If this message has reached you in error, kindly destroy it 
without review and notify the sender immediately. Any other use of such 
misdirected e-mail by you is prohibited. Where allowed by local law, electronic 
communications with Zurich and its affiliates, including e-mail and instant 
messaging (including content), may be scanned for the purposes of information 
security and assessment of internal compliance with company policy.
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Screen is square blank square window

2022-06-08 Thread Steve Lime
What version/distribution are you using? This sound familiar to another
issue I remember but I couldn't find it looking quickly in github. I
thought that was specific to a particular Windows binary distribution.
--Steve

On Wed, Jun 8, 2022 at 1:20 PM Jeremy JK  wrote:

> Hello all,
> When I call on mapserver I see nothing in the browser window
> only a grey square against a black background
> Thanks for your help
>
> this is my mapserver petition:
>
>
> http://localhost:8080/cgi-bin/mapserv?map=/opt/mapfile/mdm61vectorCaribe.map&LAYERS=cbarbados_administrativeboundaries&FORMAT=image%2Fpng&MAXRESOLUTION=4891.969809375&MINZOOMLEVEL=5&ZOOMOFFSET=5&TATO=0&LAYERNAME=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FIRM=059&SRS=EPSG%3A900913&BBOX=-12281420.399711,-1098306.4872519,-4405349.0063027,4850328.8011857&WIDTH=805&HEIGHT=608
>
> This is the log file
> 52, -6635790.2658974118530750 1476490.8980501613114029,
> -6635788.7212414033710957 1476485.6568205237854272,
> -6635788.5621886961162090 1476485.1171328218188137,
> -6635786.9534297138452530 1476479.6583917171228677,
> -6635783.4353540828451514 1476467.1054714780766517,
> -6635779.1915921270847321 1476450.7408135060686618,
> -6635777.6594455474987626 1476444.0638863830827177,
> -6635776.2385215582326055 1476434.2757148493546993,
> -6635775.0103269824758172 1476422.8186795604415238,
> -6635773.4231182178482413 1476408.2214688013773412,
> -6635772.0777894463390112 1476396.2395822617691010,
> -6635770.4671615911647677 1476382.4886730741709471,
> -6635768.7171466927975416 1476359.7367921238765121,
> -6635766.8391131982207298 1476343.5201003090478480))
> [Wed Jun  8 14:18:21 2022].812616 msPostGISLayerNextShape called.
> [Wed Jun  8 14:18:21 2022].812648 msPostGISLayerFreeItemInfo called.
> [Wed Jun  8 14:18:21 2022].812659 msPostGISLayerClose called: the_geom
> from caribe.barbados_administrativeboundaries using unique gid using
> srid=900913
> [Wed Jun  8 14:18:21 2022].812736
> msConnPoolRelease(cbarbados_administrativeboundaries,user=postgres
> password=StrongAdminP@ssw0rd dbname=postgis_db host=127.0.0.1
> port=5432,0x5648bf2b6100)
> [Wed Jun  8 14:18:21 2022].812752 msDrawMap(): Layer 20
> (cbarbados_administrativeboundaries), 0.783s
> [Wed Jun  8 14:18:21 2022].834235 msPostGISLayerIsOpen called.
> [Wed Jun  8 14:18:21 2022].843507 msConnPoolClose(user=postgres
> password=StrongAdminP@ssw0rd dbname=postgis_db host=127.0.0.1
> port=5432,0x5648bf2b6100)
>
>
>
> ___
> 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] MapScript Projection Performance

2022-06-08 Thread Steve Lime
Thanks for the response Even.

Switching to 4329 drops a few milliseconds, no major improvement.

If I still create the projection objects but don't actually project the
point object then the execution time drops back to 0m0.180s or thereabouts.
Creating the projection objects is just running msLoadProjectionString()
under the hood. Must not be doing that much - no reprojector is being
created.

$point->project() is running msProjectPoint() under the hood. I'm guessing
the reprojector is being constructed every time that's called.

Note that I don't see a performance hit with 7.6 or 8.0 (main) with CGI
when doing loads of reprojection.

So, following on your idea we'd need changes to the swig interface:

   1. reprojector.i - with a constructor to take in/out projection objects
   2. overloaded project methods added to line.i, point.i, rect.i and
   shape.i

I'll try that.

--Steve

On Wed, Jun 8, 2022 at 11:09 AM Even Rouault 
wrote:

> Steve,
>
> are you sure you don't still run into the projection initialization, or
> actually the cost to get the reprojector object from the (in, out)
> projection tuple from the cache maintained by createNormalizedPJ() ?
>
> If the following functions were mapped to SWIG
>
>MS_DLL_EXPORT reprojectionObj*
> msProjectCreateReprojector(projectionObj* in, projectionObj* out);
>
>MS_DLL_EXPORT int msProjectPointEx(reprojectionObj* reprojector,
> pointObj *point);
>
> that could be interesting to check if they speed up things.
>
> You might also try to check if using EPSG:4269 instead of EPSG:4326
> wouldn't speed up things, to eliminate the datum change from the
> equation (if you have PROJ grids available, they might be used to do the
> NAD83 -> WGS84 shift)
>
> Even
>
> Le 08/06/2022 à 17:50, Steve Lime a écrit :
> > Hi all: I have a Perl script that runs against a shapefile to project
> > a geometry centroid from UTM to Lat/Lon. Code looks something like this:
> >
> > my $proj_26915 = new mapscript::projectionObj('epsg:26915');
> > my $proj_4326 = new mapscript::projectionObj('epsg:4326');
> >
> > while (my $shape = $layer->nextShape()) {
> > my $point = $shape->getCentroid();
> > $point->project($proj_26915, $proj_4326);
> > # do something with $point
> > }
> >
> > I get the following representative timings with ~250 polygon
> > geometries in the shapefile.
> >
> >   MapServer 7.4 + Proj 6.2.1 = 0m0.180s
> >   MapServer 7.6 + Proj 6.2.1 = 0m7.000s
> >   MapServer 8.0 (main) + Proj 7.2.1 = 0m4.300s
> >
> > Huge difference and things kinda become unusable. Things improve a bit
> > with newer versions but the performance hit is substantial. I
> > thought at first that it was the projection initialization that was
> > taking all the time but it's actually the
> > "$point->project($proj_26915, $proj_4326);" statement.
> >
> > Perhaps I'm doing something wrong?
> >
> > --Steve
> >
> > ___
> > MapServer-users mailing list
> > MapServer-users@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
>
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Screen is square blank square window

2022-06-08 Thread Jeff McKenna

Hi Jeremy,

I would start always with making sure that your mapfile generates a 
valid map image, through the commandline with shp2img (or map2img with 
MapServer 8), see https://mapserver.org/utilities/shp2img.html  Such as:


  shp2img -m mdm61vectorCaribe.map -o ttt.png -all_debug 3

Make sure your boundaries layer appears nicely in your map image, and 
then once you have that ready, move onto your application request or WMS 
GetMap testing, etc.


PS. be careful with your EPSG:900913 use, as this is long deprecated (in 
most FOSS4G software now) as EPSG:3857 is recommended instead.  Read 
more about this at https://mapserver.org/mapfile/projection.html  But 
don't worry about the fun projection issues yet, start with 
shp2img/map2img first.


-jeff



--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/



On 2022-06-08 3:19 p.m., Jeremy JK wrote:

Hello all,
When I call on mapserver I see nothing in the browser window
only a grey square against a black background
Thanks for your help

this is my mapserver petition:

http://localhost:8080/cgi-bin/mapserv?map=/opt/mapfile/mdm61vectorCaribe.map&LAYERS=cbarbados_administrativeboundaries&FORMAT=image%2Fpng&MAXRESOLUTION=4891.969809375&MINZOOMLEVEL=5&ZOOMOFFSET=5&TATO=0&LAYERNAME=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FIRM=059&SRS=EPSG%3A900913&BBOX=-12281420.399711,-1098306.4872519,-4405349.0063027,4850328.8011857&WIDTH=805&HEIGHT=608 



This is the log file
52, -6635790.2658974118530750 1476490.8980501613114029, 
-6635788.7212414033710957 1476485.6568205237854272, 
-6635788.5621886961162090 1476485.1171328218188137, 
-6635786.9534297138452530 1476479.6583917171228677, 
-6635783.4353540828451514 1476467.1054714780766517, 
-6635779.1915921270847321 1476450.7408135060686618, 
-6635777.6594455474987626 1476444.0638863830827177, 
-6635776.2385215582326055 1476434.2757148493546993, 
-6635775.0103269824758172 1476422.8186795604415238, 
-6635773.4231182178482413 1476408.2214688013773412, 
-6635772.0777894463390112 1476396.2395822617691010, 
-6635770.4671615911647677 1476382.4886730741709471, 
-6635768.7171466927975416 1476359.7367921238765121, 
-6635766.8391131982207298 1476343.5201003090478480))

[Wed Jun  8 14:18:21 2022].812616 msPostGISLayerNextShape called.
[Wed Jun  8 14:18:21 2022].812648 msPostGISLayerFreeItemInfo called.
[Wed Jun  8 14:18:21 2022].812659 msPostGISLayerClose called: the_geom 
from caribe.barbados_administrativeboundaries using unique gid using 
srid=900913
[Wed Jun  8 14:18:21 2022].812736 
msConnPoolRelease(cbarbados_administrativeboundaries,user=postgres 
password=StrongAdminP@ssw0rd dbname=postgis_db host=127.0.0.1 
port=5432,0x5648bf2b6100)
[Wed Jun  8 14:18:21 2022].812752 msDrawMap(): Layer 20 
(cbarbados_administrativeboundaries), 0.783s

[Wed Jun  8 14:18:21 2022].834235 msPostGISLayerIsOpen called.
[Wed Jun  8 14:18:21 2022].843507 msConnPoolClose(user=postgres 
password=StrongAdminP@ssw0rd dbname=postgis_db host=127.0.0.1 
port=5432,0x5648bf2b6100)





___
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] Screen is square blank square window

2022-06-08 Thread Jeremy JK
Hello all,
When I call on mapserver I see nothing in the browser window
only a grey square against a black background
Thanks for your help

this is my mapserver petition:

http://localhost:8080/cgi-bin/mapserv?map=/opt/mapfile/mdm61vectorCaribe.map&LAYERS=cbarbados_administrativeboundaries&FORMAT=image%2Fpng&MAXRESOLUTION=4891.969809375&MINZOOMLEVEL=5&ZOOMOFFSET=5&TATO=0&LAYERNAME=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FIRM=059&SRS=EPSG%3A900913&BBOX=-12281420.399711,-1098306.4872519,-4405349.0063027,4850328.8011857&WIDTH=805&HEIGHT=608

This is the log file
52, -6635790.2658974118530750 1476490.8980501613114029,
-6635788.7212414033710957 1476485.6568205237854272,
-6635788.5621886961162090 1476485.1171328218188137,
-6635786.9534297138452530 1476479.6583917171228677,
-6635783.4353540828451514 1476467.1054714780766517,
-6635779.1915921270847321 1476450.7408135060686618,
-6635777.6594455474987626 1476444.0638863830827177,
-6635776.2385215582326055 1476434.2757148493546993,
-6635775.0103269824758172 1476422.8186795604415238,
-6635773.4231182178482413 1476408.2214688013773412,
-6635772.0777894463390112 1476396.2395822617691010,
-6635770.4671615911647677 1476382.4886730741709471,
-6635768.7171466927975416 1476359.7367921238765121,
-6635766.8391131982207298 1476343.5201003090478480))
[Wed Jun  8 14:18:21 2022].812616 msPostGISLayerNextShape called.
[Wed Jun  8 14:18:21 2022].812648 msPostGISLayerFreeItemInfo called.
[Wed Jun  8 14:18:21 2022].812659 msPostGISLayerClose called: the_geom from
caribe.barbados_administrativeboundaries using unique gid using srid=900913
[Wed Jun  8 14:18:21 2022].812736
msConnPoolRelease(cbarbados_administrativeboundaries,user=postgres
password=StrongAdminP@ssw0rd dbname=postgis_db host=127.0.0.1
port=5432,0x5648bf2b6100)
[Wed Jun  8 14:18:21 2022].812752 msDrawMap(): Layer 20
(cbarbados_administrativeboundaries), 0.783s
[Wed Jun  8 14:18:21 2022].834235 msPostGISLayerIsOpen called.
[Wed Jun  8 14:18:21 2022].843507 msConnPoolClose(user=postgres
password=StrongAdminP@ssw0rd dbname=postgis_db host=127.0.0.1
port=5432,0x5648bf2b6100)
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] MapScript Projection Performance

2022-06-08 Thread Even Rouault

Steve,

are you sure you don't still run into the projection initialization, or 
actually the cost to get the reprojector object from the (in, out) 
projection tuple from the cache maintained by createNormalizedPJ() ?


If the following functions were mapped to SWIG

  MS_DLL_EXPORT reprojectionObj* 
msProjectCreateReprojector(projectionObj* in, projectionObj* out);


  MS_DLL_EXPORT int msProjectPointEx(reprojectionObj* reprojector, 
pointObj *point);


that could be interesting to check if they speed up things.

You might also try to check if using EPSG:4269 instead of EPSG:4326 
wouldn't speed up things, to eliminate the datum change from the 
equation (if you have PROJ grids available, they might be used to do the 
NAD83 -> WGS84 shift)


Even

Le 08/06/2022 à 17:50, Steve Lime a écrit :
Hi all: I have a Perl script that runs against a shapefile to project 
a geometry centroid from UTM to Lat/Lon. Code looks something like this:


my $proj_26915 = new mapscript::projectionObj('epsg:26915');
my $proj_4326 = new mapscript::projectionObj('epsg:4326');

while (my $shape = $layer->nextShape()) {
    my $point = $shape->getCentroid();
    $point->project($proj_26915, $proj_4326);
    # do something with $point
}

I get the following representative timings with ~250 polygon 
geometries in the shapefile.


  MapServer 7.4 + Proj 6.2.1 = 0m0.180s
  MapServer 7.6 + Proj 6.2.1 = 0m7.000s
  MapServer 8.0 (main) + Proj 7.2.1 = 0m4.300s

Huge difference and things kinda become unusable. Things improve a bit 
with newer versions but the performance hit is substantial. I 
thought at first that it was the projection initialization that was 
taking all the time but it's actually the 
"$point->project($proj_26915, $proj_4326);" statement.


Perhaps I'm doing something wrong?

--Steve

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


--
http://www.spatialys.com
My software is free, but my time generally not.

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


[mapserver-users] MapScript Projection Performance

2022-06-08 Thread Steve Lime
Hi all: I have a Perl script that runs against a shapefile to project a
geometry centroid from UTM to Lat/Lon. Code looks something like this:

my $proj_26915 = new mapscript::projectionObj('epsg:26915');
my $proj_4326 = new mapscript::projectionObj('epsg:4326');

while (my $shape = $layer->nextShape()) {
my $point = $shape->getCentroid();
$point->project($proj_26915, $proj_4326);
# do something with $point
}

I get the following representative timings with ~250 polygon geometries in
the shapefile.

  MapServer 7.4 + Proj 6.2.1 = 0m0.180s
  MapServer 7.6 + Proj 6.2.1 = 0m7.000s
  MapServer 8.0 (main) + Proj 7.2.1 = 0m4.300s

Huge difference and things kinda become unusable. Things improve a bit with
newer versions but the performance hit is substantial. I thought at first
that it was the projection initialization that was taking all the time but
it's actually the "$point->project($proj_26915, $proj_4326);" statement.

Perhaps I'm doing something wrong?

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