[mapserver-users] Symbols at tile edges

2014-03-17 Thread Dave Barter
Is there any way to prevent symbols being clipped/rendered at tile edges using 
just mapserver?

I have created direction arrows as a filled vector symbol and placed these as 
follows:-

SYMBOL
                NAME arrow
                TYPE vector
                FILLED true
                POINTS
                    0 0.4
                    1 0.4
                    1 0
                    2 0.8
                    1 1.6
                    1 1.2
                    0 1.2
                    0 0.4
                END
                ANCHORPOINT 1 0.8
 END 

 
STYLE
                          GAP -300.0
                          COLOR 128 128 128
                          OUTLINECOLOR 0 0 0
                          SYMBOL arrow
                          SIZE 12.0
                          ANGLE AUTO
                            OFFSET 10 -99
END

When viewed as a WMS layer in open layers I find that arrows placed on a line 
close to a tile edge are being clipped. The layer uses Request parameters and 
cannot be proxied through map cache. As you can see below it uses  %worker% to 
pick the right table.

DATA wkb_geometry from (SELECT work_item_sequence as seq, 
count(work_item_sequence), (st_collect(route_line)) as wkb_geometry FROM 
ng_worker.worker_%worker%_route_table GROUP by work_item_sequence ORDER by 
work_item_sequence ASC ) AS FOO using unique seq using srid=27700___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Postgis Tile Index

2014-08-20 Thread Dave Barter
I want to create a WMS service from map server that has raster tiles stored in 
a postgis database

I have loaded the tiles and have a table RASTERS as follows:-

CREATE TABLE mapping_raster.streetview
(
  rid serial NOT NULL,
  rast raster,
  filename text,
  CONSTRAINT streetview_pkey PRIMARY KEY (rid)
)

I understand that Mapserver now needs two layers as per this link 
https://trac.osgeo.org/mapserver/wiki/DatabaseTileIndex

How do I create the tile index table from my raster data? The Oracle example 
query looks like:-

create or replace view my_raster_tindex as select some_attribute, 'geor: 
user/pass@tns, raster_table_DATA,'||r.raster.rasterid location, 
R.RASTER.spatialextent shape from rasters_table r;

I don’t properly understand which attribute links to the raster in the tile 
index?

TIA
Dave 

-- 
Dave Barter

Web: http://www.phased.co.uk
Email:d...@phased.co.uk
Twitter:@Citizenfishy___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Postgis Tile Index

2014-08-20 Thread Dave Barter
..just needed to read the documentation a little harder, I’m assuming it is:-

CREATE MATERIALIZED VIEW mapping_raster.streetview_tileindex AS SELECT rid as 
location, ST_ConvexHull(rast) as shape from mapping_raster.streetview 

-- 
Dave Barter

Web: http://www.phased.co.uk
Email:d...@phased.co.uk
Twitter:@Citizenfishy___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Postgis Tile Index

2014-08-20 Thread Dave Barter
Final question. How should my map file look in order to get the raster tile 
from the database not the file system?

LAYER
            # CREATE MATERIALIZED VIEW 
mapping_os_opendata_raster.streetview_tileindex AS SELECT rid as location, 
ST_ConvexHull(rast) as shape from mapping_os_opendata_raster.streetview 
            NAME streetview_tileindex
            TYPE polygon
            PROJECTION
                init=epsg:27700
            END
            CONNECTIONTYPE postgis
            CONNECTION “
            DATA shape from (SELECT shape,location FROM 
mapping_os_opendata_raster.streetview_tileindex) AS FOO USING UNIQUE location 
using srid=27700

        END

        LAYER
            #RASTER TILE LAYERS MUST RUN FROM A TILEINDEX
            NAME streetview
            TYPE RASTER
            STATUS ON
            TILEINDEX streetview_tileindex
            TILEITEM location
            OFFSITE 0 0 0 
            PROJECTION
                init=epsg:27700
            END
            DEBUG 5
            EXTENT 0 0 300 100

        END

This is not working as the layer street view returns an error:- 

msDrawMap(): Image handling error. Failed to draw layer named 'streetview'. 
msDrawRasterLayerLow(): Unable to access file. Corrupt, empty or missing file 
'654016' for layer 'street view’.

I set SHAPEFILE “” at the top of the file, but am unclear as to how the 
streetview layer will retrieve the tile ?



-- 
Dave Barter

Web: http://www.phased.co.uk
Email:d...@phased.co.uk
Twitter:@Citizenfishy___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Postgis Tile Index

2014-08-20 Thread Dave Barter
I’ve figured this out,

CREATE MATERIALIZED VIEW mapping_os_opendata_raster.streetview_tileindex AS 
SELECT rid as location, ST_ConvexHull(rast) as shape from 
mapping_os_opendata_raster.streetview 


“location needs to be a path to the database/table/raster currently it is just 
returning an ID, but I cannot find any documentation as to how to construct 
this for postgres

So nearly there?

On 20 August 2014 at 11:34:03, Dave Barter (dave.bar...@gmail.com) wrote:

Final question. How should my map file look in order to get the raster tile 
from the database not the file system?

LAYER
            # CREATE MATERIALIZED VIEW 
mapping_os_opendata_raster.streetview_tileindex AS SELECT rid as location, 
ST_ConvexHull(rast) as shape from mapping_os_opendata_raster.streetview 
            NAME streetview_tileindex
            TYPE polygon
            PROJECTION
                init=epsg:27700
            END
            CONNECTIONTYPE postgis
            CONNECTION “
            DATA shape from (SELECT shape,location FROM 
mapping_os_opendata_raster.streetview_tileindex) AS FOO USING UNIQUE location 
using srid=27700

        END

        LAYER
            #RASTER TILE LAYERS MUST RUN FROM A TILEINDEX
            NAME streetview
            TYPE RASTER
            STATUS ON
            TILEINDEX streetview_tileindex
            TILEITEM location
            OFFSITE 0 0 0 
            PROJECTION
                init=epsg:27700
            END
            DEBUG 5
            EXTENT 0 0 300 100

        END

This is not working as the layer street view returns an error:- 

msDrawMap(): Image handling error. Failed to draw layer named 'streetview'. 
msDrawRasterLayerLow(): Unable to access file. Corrupt, empty or missing file 
'654016' for layer 'street view’.

I set SHAPEFILE “” at the top of the file, but am unclear as to how the 
streetview layer will retrieve the tile ?



-- 
Dave Barter

Web: http://www.phased.co.uk
Email:d...@phased.co.uk
Twitter:@Citizenfishy___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] [EXTERNAL] Re: Postgis Tile Index

2014-08-20 Thread Dave Barter
I have this working now:-

CREATE MATERIALIZED VIEW mapping_raster.streetview_tileindex AS 
SELECT 'PG:host=localhost port=5432 …. schema=''mapping__raster'' 
table=''streetview'' mode=''1'' where=rid='||rid as location, 
ST_ConvexHull(rast) as shape from mapping_raster.streetview 

Thanks for the help, I will update the wiki shortly

On 20 August 2014 at 12:15:48, Smith, Michael ERDC-RDE-CRREL-NH 
(michael.sm...@erdc.dren.mil) wrote:

Note that the current Wiki entry is here: 
https://github.com/mapserver/mapserver/wiki/MapServer-TILEINDEXes-with-Database-RASTERS

And when you do get this working, please update this for the other PostGIS 
users.

Mike

-- 
Michael Smith
US Army Corps
Remote Sensing GIS/Center

From: Rahkonen Jukka (Tike) jukka.rahko...@mmmtike.fi
Date: Wednesday, August 20, 2014 at 6:56 AM
To: Dave Barter dave.bar...@gmail.com, mapserver-users@lists.osgeo.org 
mapserver-users@lists.osgeo.org
Subject: [EXTERNAL] Re: [mapserver-users] Postgis Tile Index
Resent-From: Michael Smith michael.sm...@usace.army.mil

Perhaps it is something like this (from 
http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html)

 

“Reading raster data from the database

If you want to use the GDAL WKT Raster driver, you must provide a connection 
string as Dataset's name. The syntax of this connection string is (the quotes 
may be ommitted):

PG:host='host' port:'port' dbname='dbname' user='user' 
password='password' [schema='schema'] [table='raster_table'] 
[where='sql_where'] [mode='working_mode']

 

I would test first by using the string for one image as  DATA of your raster 
layer before to continue towards TILEINDEX+TILEITEM.

 

-Jukka Rahkonen-

 

Dave Barter wrote:

 

I’ve figured this out,

 

CREATE MATERIALIZED VIEW mapping_os_opendata_raster.streetview_tileindex AS 
SELECT rid as location, ST_ConvexHull(rast) as shape from 
mapping_os_opendata_raster.streetview 

 

“location needs to be a path to the database/table/raster currently it is just 
returning an ID, but I cannot find any documentation as to how to construct 
this for postgres

So nearly there?

 

On 20 August 2014 at 11:34:03, Dave Barter (dave.bar...@gmail.com) wrote:

Final question. How should my map file look in order to get the raster tile 
from the database not the file system?

 

LAYER

            # CREATE MATERIALIZED VIEW 
mapping_os_opendata_raster.streetview_tileindex AS SELECT rid as location, 
ST_ConvexHull(rast) as shape from mapping_os_opendata_raster.streetview 

            NAME streetview_tileindex

            TYPE polygon

            PROJECTION

                init=epsg:27700

            END

            CONNECTIONTYPE postgis

            CONNECTION “

            DATA shape from (SELECT shape,location FROM 
mapping_os_opendata_raster.streetview_tileindex) AS FOO USING UNIQUE location 
using srid=27700

 

        END

 

        LAYER

            #RASTER TILE LAYERS MUST RUN FROM A TILEINDEX

            NAME streetview

            TYPE RASTER

            STATUS ON

            TILEINDEX streetview_tileindex

            TILEITEM location

            OFFSITE 0 0 0 

            PROJECTION

                init=epsg:27700

            END

            DEBUG 5

            EXTENT 0 0 300 100

 

        END

 

This is not working as the layer street view returns an error:- 

 

msDrawMap(): Image handling error. Failed to draw layer named 'streetview'. 
msDrawRasterLayerLow(): Unable to access file. Corrupt, empty or missing file 
'654016' for layer 'street view’.

 

I set SHAPEFILE “” at the top of the file, but am unclear as to how the 
streetview layer will retrieve the tile ?

 

 

 

-- 
Dave Barter

Web: http://www.phased.co.uk
Email:d...@phased.co.uk
Twitter:@Citizenfishy___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Postgis Raster Layer

2014-08-20 Thread Dave Barter
One final question for today!

When I use mapserver wms to serve the raster tiles from the file system, they 
look fine. But doing it from the database gives me problems with the black 
labels as can be seen by the image at 
http://phased.co.uk/wp-content/uploads/Screen-Shot-2014-08-20-at-15.49.09.png

Is there a way I can fix this? The rasters in the database are fine and not 
corrupted, I’ve checked this by exporting and viewing one.

Dave

-- 

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

Re: [mapserver-users] Postgis Raster Layer

2014-08-20 Thread Dave Barter
Further investigation in QGIS shows that it is pixel value 161 that is not 
displaying

gdalinfo tells me that  161: 0,0,0,255 for the raster

So, can I correct this in map server, and why is it not rendering it as black?
On 20 August 2014 at 16:12:06, Andrea Peri (aperi2...@gmail.com) wrote:

I guess iT is a resampling question.
My theory is that you dont see this issue with on polygon filled with solid 
color because the resample strategy find the same color in all the considered 
portion of polygon.
This is not true for  labels or lines.

If this theory is true, it should fail also with points and with other colors.
Not only black.

A.

Il 20/ago/2014 17:04 Dave Barter dave.bar...@gmail.com ha scritto:
Yes, it appears to be related to the black colour
On 20 August 2014 at 16:03:15, Andrea Peri (aperi2...@gmail.com) wrote:

AFAIK
The same problem of the label is also on lines. See in your sample the 
boundaries of street.

A.

Il 20/ago/2014 16:53 Dave Barter dave.bar...@gmail.com ha scritto:
One final question for today!

When I use mapserver wms to serve the raster tiles from the file system, they 
look fine. But doing it from the database gives me problems with the black 
labels as can be seen by the image at 
http://phased.co.uk/wp-content/uploads/Screen-Shot-2014-08-20-at-15.49.09.png

Is there a way I can fix this? The rasters in the database are fine and not 
corrupted, I’ve checked this by exporting and viewing one.

Dave

-- 


___
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
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Mapcache to generate TMS?

2017-02-15 Thread Dave Barter
This is probably a daft question, but can mapcache be used to generate a static 
tile set for use by a TMS service?

I was thinking this would be achieved using the tile seeder at zoom levels 0 - 
20 and then pointing the TMS at the cache directory
 


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

[mapserver-users] Single image mapfile

2016-10-10 Thread Dave Barter
Would this be feasible in a mapfile alone?

I pass in a url with a feature_id in it. Say:-

[URL TO MAP FILE]?feature_id=124

The map file uses a postgres query to retrieve the feature_id’s geometry as a 
point and then clips a raster layer to a kilometre bounding box around the 
point. 

A single jpg/tif/png would be returned with the point marked in the correct 
position on the raster


This url could then be used on a webpage to show a small map snippet for the 
feature’s location.


Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

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

[mapserver-users] Kernel density layer tile clipping

2016-12-13 Thread Dave Barter
Can anyone help me troubleshoot some tile clipping we are getting when using 
Kernel Desity layers?

I have set up the layer as below but am still seeing tiles clipped at certain 
zoom levels. I tried increasing the tile size which improved things but not 
100%:-

LAYER
 NAME feature_heatmap
 SIZEUNITS meters
 TYPE raster
 CONNECTIONTYPE kerneldensity
 CONNECTION "point_data"
 STATUS ON


 PROCESSING "RANGE_COLORSPACE=HSL"
 PROCESSING "KERNELDENSITY_RADIUS=25"
 PROCESSING "KERNELDENSITY_COMPUTE_BORDERS=ON"
 PROCESSING "KERNELDENSITY_NORMALIZATION=AUTO"
 OFFSITE 0 0 0

   CLASS
 STYLE
   COLORRANGE  "#"  "#FFFF"
   DATARANGE 0 255
 END
   END
   #MAXSCALE 2
   DEBUG 0
END


Any ideas appreciated.

Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

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

Re: [mapserver-users] Kernel Density

2016-12-01 Thread Dave Barter
Thanks, this has got to the nub of it as:-

SIZE 1 and SIZE 100 and SIZE 255 show no difference so SIZE is not making it in 
to the Kernelt density layer at all?


Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

> On 1 Dec 2016, at 14:56, thomas bonfort <thomas.bonf...@gmail.com> wrote:
> 
> Forget my datarange comment, I should have re-read the docs. I see nothing 
> wrong with your setup, so you should be getting a different output provided 
> you are certain your [val] attribute is effectively ranging from 0 to 100.
> You might get some insights with:
> - Try manually setting your STYLE->SIZE (0 then 100 then 255)
> - Try with AUTO normalization once you've re-enabled [val] binding
> 
> --
> thomas
> 
> On Thu, Dec 1, 2016 at 3:39 PM thomas bonfort <thomas.bonf...@gmail.com 
> <mailto:thomas.bonf...@gmail.com>> wrote:
> At a first glance your mapfile seems correct. Can you try switching your 
> datarange to  0 50, and make sure that you are not using a tiled display on 
> your viewer?
> 
> --
> thomas
> 
> On Thu, Dec 1, 2016 at 3:27 PM Dave Barter <d...@phased.co.uk 
> <mailto:d...@phased.co.uk>> wrote:
> Can anyone on the list help with this:-
> 
> http://gis.stackexchange.com/questions/219669/mapserver-kernel-density-layer-weight
>  
> <http://gis.stackexchange.com/questions/219669/mapserver-kernel-density-layer-weight>
> 
> 
> Dave Barter
> d...@phased.co.uk <mailto:d...@phased.co.uk>
> @citizenfishy
> www.phased.co.uk <http://www.phased.co.uk/>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
> <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] Kernel Density

2016-12-01 Thread Dave Barter
Figured it out.

My bad as the map file was correct. Turns out the values were set the same 
across the points down to a bug in our application editor!!

Thansk for helping me get to this point.

Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

> On 1 Dec 2016, at 14:56, thomas bonfort <thomas.bonf...@gmail.com> wrote:
> 
> Forget my datarange comment, I should have re-read the docs. I see nothing 
> wrong with your setup, so you should be getting a different output provided 
> you are certain your [val] attribute is effectively ranging from 0 to 100.
> You might get some insights with:
> - Try manually setting your STYLE->SIZE (0 then 100 then 255)
> - Try with AUTO normalization once you've re-enabled [val] binding
> 
> --
> thomas
> 
> On Thu, Dec 1, 2016 at 3:39 PM thomas bonfort <thomas.bonf...@gmail.com 
> <mailto:thomas.bonf...@gmail.com>> wrote:
> At a first glance your mapfile seems correct. Can you try switching your 
> datarange to  0 50, and make sure that you are not using a tiled display on 
> your viewer?
> 
> --
> thomas
> 
> On Thu, Dec 1, 2016 at 3:27 PM Dave Barter <d...@phased.co.uk 
> <mailto:d...@phased.co.uk>> wrote:
> Can anyone on the list help with this:-
> 
> http://gis.stackexchange.com/questions/219669/mapserver-kernel-density-layer-weight
>  
> <http://gis.stackexchange.com/questions/219669/mapserver-kernel-density-layer-weight>
> 
> 
> Dave Barter
> d...@phased.co.uk <mailto:d...@phased.co.uk>
> @citizenfishy
> www.phased.co.uk <http://www.phased.co.uk/>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
> <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

[mapserver-users] Kernel Density

2016-12-01 Thread Dave Barter
Can anyone on the list help with this:-

http://gis.stackexchange.com/questions/219669/mapserver-kernel-density-layer-weight
 
<http://gis.stackexchange.com/questions/219669/mapserver-kernel-density-layer-weight>


Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

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

[mapserver-users] International Fonts - OSM Data

2017-08-09 Thread Dave Barter
I’ve done a planet load of OSM and when I view countries in the database using 
PGADMIN I can see them correctly encoded as per the image below:-

http://imgbox.com/Z5SJ911X 

My Mapfile looks like this:-

CLASS
 EXPRESSION 'country'
 LABEL
  FONT sc
  TYPE TRUETYPE
  ENCODING "utf-8"
  SIZE 8
  COLOR 100 100 100
  OUTLINECOLOR -1 -1 -1
  OUTLINEWIDTH 2
  WRAP ' '
  MAXLENGTH 8
  ALIGN CENTER
  BUFFER 4
  PARTIALS FALSE
  POSITION cc
 END
END

Which renders some of the characters but not Ethiopia as shown by this image

http://imgbox.com/vnGmn7jT 

My database server is using UTF8 as the encoding. So Is the problem with my 
font?

sc maps to DejaVuSansCondensed.ttf

I am guessing some characters are missing or I need to use another font?


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

Re: [mapserver-users] International Fonts - OSM Data

2017-08-10 Thread Dave Barter
> 
> Dave,
> The Noto font aims at resolving this issue: https://www.google.com/get/noto/ 
> 
> 
> Aside from that mapserver supports language specific fonts. This needs 
> documenting aside from what can be found in the RFC 
> http://mapserver.org/development/rfc/ms-rfc-98.html 
>  (which has a typo, use 
> s/LABEL/FONT/)
> 
> FONT "arialuni,en:arial,ja:cjk,ar:arabic"
> 
> will use a specific font for a given language code. Collecting all the fonts 
> and mapping them to all the language codes for a worldwide osm db will be a 
> tiresome job...
> 

Thanks for the guidance. This may be a really stupid question but given I can 
find the Ethiopia record in the database how can I establish its language code?


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

[mapserver-users] Fixed positioning

2017-08-08 Thread Dave Barter
Is it possible for me to have a layer that places a symbol at the centre of the 
generated tile and text at a fixed position from the bottom?

My aim is to make a single WMS tile call to get back a map image with marker at 
centre and text at bottom.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Segfault - LINE layer

2017-08-18 Thread Dave Barter
This call:-

/usr/lib/cgi-bin/mapserv.ngx -nh 
"QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map=WMS=1.1.1=GetMap=WMS==-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384=276=276=image%2fpng=EPSG%3a3857=roads8=false

Is giving me:-

Segmentation fault (core dumped)

For the layer definition:-

LAYER
GROUP "default"
STATUS ON
TYPE LINE
MINSCALEDENOM 1300032
MAXSCALEDENOM 2600064
NAME "roads8"
DEBUG 5
CONNECTIONTYPE postgis
PROCESSING "CLOSE_CONNECTION=DEFER"
{%public_map_user%}
PROJECTION
"init=epsg:900913"
END
DATA "geometry from (select osm_id,geometry,name as name,ref,type from 
mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') 
order by z_order asc) as foo using unique osm_id using srid=900913"
LABELITEM "name"
CLASSITEM "type"
CLASS
EXPRESSION {primary,primary_link}
STYLE
WIDTH 0.5
COLOR 242 242 242
END
END
CLASS
EXPRESSION "motorway"
TEXT ("[ref]")
STYLE
   WIDTH 1
   OUTLINEWIDTH 0.5
   OUTLINECOLOR 217 217 217
END
STYLE
WIDTH 1
COLOR 242 242 242

END
END
CLASS
EXPRESSION "trunk"
TEXT ("[ref]")
STYLE
   WIDTH 1
   OUTLINEWIDTH 0.5
   OUTLINECOLOR 217 217 217
END
STYLE
WIDTH 1
 COLOR 242 242 242
END
END
END

When I look in my debug file I see the following as last set of lines:-

[Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7
[Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary"
[Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0
[Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] ""
[Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0
[Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] ""
[Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 
307691570
[Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting 
shape->resultindex = 327
[Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570
[Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING 
(139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 
6233447.9814142314717174)
[Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called.
[Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called.
[Fri Aug 18 11:09:39 2017].94

So it seems to segfault during  msPostGISReadShape. 

I’ve checked the query and it is pulling 3110 linestrings from the database. 

But I am not sure why is is segfaulting? Is this a bug?

Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

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

Re: [mapserver-users] Segfault - LINE layer

2017-08-18 Thread Dave Barter

>  
> As a quick workaround edit your DATA:
>  
> where type in ('trunk','motorway','primary') AND geometry is not null
>  
> -Jukka Rahkonen-


That will not work as an empty geometry is not null

The fix is WHERE NOT ST_EMPTY(geometry)


>  
> Lähettäjä: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org 
> <mailto:mapserver-users-boun...@lists.osgeo.org>] Puolesta Dave Barter
> Lähetetty: 18. elokuuta 2017 16:05
> Vastaanottaja: mapserver-users@lists.osgeo.org 
> <mailto:mapserver-users@lists.osgeo.org>
> Aihe: Re: [mapserver-users] Segfault - LINE layer
>  
>  
> On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) <steve.l...@state.mn.us 
> <mailto:steve.l...@state.mn.us>> wrote:
>  
> I'd call it a bug. What version? Can you prepare a small test case? 
>  
> MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
> SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS 
> SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER 
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT 
> SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS 
> SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>  
> I have tracked it down to a specific geometry:-
>  
> 010200 = ‘LINESTRING EMPTY’
>  
>  
>  
> From: mapserver-users <mapserver-users-boun...@lists.osgeo.org 
> <mailto:mapserver-users-boun...@lists.osgeo.org>> on behalf of Dave Barter 
> <d...@phased.co.uk <mailto:d...@phased.co.uk>>
> Sent: Friday, August 18, 2017 5:13:29 AM
> To: mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org>
> Subject: [mapserver-users] Segfault - LINE layer
>  
> This call:-
> 
> /usr/lib/cgi-bin/mapserv.ngx -nh 
> "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map=WMS=1.1.1=GetMap=WMS==-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384=276=276=image%2fpng=EPSG%3a3857=roads8=false
> 
> Is giving me:-
> 
> Segmentation fault (core dumped)
> 
> For the layer definition:-
> 
> LAYER
> GROUP "default"
> STATUS ON
> TYPE LINE
> MINSCALEDENOM 1300032
> MAXSCALEDENOM 2600064
> NAME "roads8"
> DEBUG 5
> CONNECTIONTYPE postgis
> PROCESSING "CLOSE_CONNECTION=DEFER"
> {%public_map_user%}
> PROJECTION
> "init=epsg:900913"
> END
> DATA "geometry from (select osm_id,geometry,name as name,ref,type from 
> mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') 
> order by z_order asc) as foo using unique osm_id using srid=900913"
> LABELITEM "name"
> CLASSITEM "type"
> CLASS
> EXPRESSION {primary,primary_link}
> STYLE
> WIDTH 0.5
> COLOR 242 242 242
> END
> END
> CLASS
> EXPRESSION "motorway"
> TEXT ("[ref]")
> STYLE
>WIDTH 1
>OUTLINEWIDTH 0.5
>OUTLINECOLOR 217 217 217
> END
> STYLE
> WIDTH 1
> COLOR 242 242 242
> 
> END
> END
> CLASS
> EXPRESSION "trunk"
> TEXT ("[ref]")
> STYLE
>WIDTH 1
>OUTLINEWIDTH 0.5
>OUTLINECOLOR 217 217 217
> END
> STYLE
> WIDTH 1
>  COLOR 242 242 242
> END
> END
> END
> 
> When I look in my debug file I see the following as last set of lines:-
> 
> [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7
> [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary"
> [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0
> [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] ""
> [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0
> [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] ""
> [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 
> 307691570
> [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting 
> shape->resultindex = 327
> [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570
> [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING 
> (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 
> 6233447.9814142314717174)
> [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called.
> [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called.

Re: [mapserver-users] Segfault - LINE layer

2017-08-18 Thread Dave Barter

> On 18 Aug 2017, at 13:44, Lime, Steve D (MNIT) <steve.l...@state.mn.us> wrote:
> 
> I'd call it a bug. What version? Can you prepare a small test case? 

MapServer version 7.0.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS 
SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

I have tracked it down to a specific geometry:-

010200 = ‘LINESTRING EMPTY’



> 
> From: mapserver-users <mapserver-users-boun...@lists.osgeo.org 
> <mailto:mapserver-users-boun...@lists.osgeo.org>> on behalf of Dave Barter 
> <d...@phased.co.uk <mailto:d...@phased.co.uk>>
> Sent: Friday, August 18, 2017 5:13:29 AM
> To: mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org>
> Subject: [mapserver-users] Segfault - LINE layer
>  
> This call:-
> 
> /usr/lib/cgi-bin/mapserv.ngx -nh 
> "QUERY_STRING=map=/usr/src/app/mapfiles/api/wms_osm_google_world_bw.map=WMS=1.1.1=GetMap=WMS==-6114.962263%2c6099063.360931%2c162657.996191%2c6267836.319384=276=276=image%2fpng=EPSG%3a3857=roads8=false
> 
> Is giving me:-
> 
> Segmentation fault (core dumped)
> 
> For the layer definition:-
> 
> LAYER
> GROUP "default"
> STATUS ON
> TYPE LINE
> MINSCALEDENOM 1300032
> MAXSCALEDENOM 2600064
> NAME "roads8"
> DEBUG 5
> CONNECTIONTYPE postgis
> PROCESSING "CLOSE_CONNECTION=DEFER"
> {%public_map_user%}
> PROJECTION
> "init=epsg:900913"
> END
> DATA "geometry from (select osm_id,geometry,name as name,ref,type from 
> mapping_osm.osm_new_roads_gen1 where type in ('trunk','motorway','primary') 
> order by z_order asc) as foo using unique osm_id using srid=900913"
> LABELITEM "name"
> CLASSITEM "type"
> CLASS
> EXPRESSION {primary,primary_link}
> STYLE
> WIDTH 0.5
> COLOR 242 242 242
> END
> END
> CLASS
> EXPRESSION "motorway"
> TEXT ("[ref]")
> STYLE
>WIDTH 1
>OUTLINEWIDTH 0.5
>OUTLINECOLOR 217 217 217
> END
> STYLE
> WIDTH 1
> COLOR 242 242 242
> 
> END
> END
> CLASS
> EXPRESSION "trunk"
> TEXT ("[ref]")
> STYLE
>WIDTH 1
>OUTLINEWIDTH 0.5
>OUTLINECOLOR 217 217 217
> END
> STYLE
> WIDTH 1
>  COLOR 242 242 242
> END
> END
> END
> 
> When I look in my debug file I see the following as last set of lines:-
> 
> [Fri Aug 18 11:09:39 2017].945225 msPostGISReadShape: PQgetlength = 7
> [Fri Aug 18 11:09:39 2017].945236 msPostGISReadShape: [type] "primary"
> [Fri Aug 18 11:09:39 2017].945248 msPostGISReadShape: PQgetlength = 0
> [Fri Aug 18 11:09:39 2017].945259 msPostGISReadShape: [name] ""
> [Fri Aug 18 11:09:39 2017].945270 msPostGISReadShape: PQgetlength = 0
> [Fri Aug 18 11:09:39 2017].945281 msPostGISReadShape: [ref] ""
> [Fri Aug 18 11:09:39 2017].945292 msPostGISReadShape: Setting shape->index = 
> 307691570
> [Fri Aug 18 11:09:39 2017].945303 msPostGISReadShape: Setting 
> shape->resultindex = 327
> [Fri Aug 18 11:09:39 2017].945314 msPostGISReadShape: [index] 307691570
> [Fri Aug 18 11:09:39 2017].945346 msPostGISReadShape: [shape] LINESTRING 
> (139231.1053743003285490 6233477.4797634640708566, 139274.7760105324559845 
> 6233447.9814142314717174)
> [Fri Aug 18 11:09:39 2017].945369 msPostGISLayerNextShape called.
> [Fri Aug 18 11:09:39 2017].945383 msPostGISReadShape called.
> [Fri Aug 18 11:09:39 2017].94
> 
> So it seems to segfault during  msPostGISReadShape. 
> 
> I’ve checked the query and it is pulling 3110 linestrings from the database. 
> 
> But I am not sure why is is segfaulting? Is this a bug?
> 
> Dave Barter
> d...@phased.co.uk <mailto:d...@phased.co.uk>
> @citizenfishy
> www.phased.co.uk <http://www.phased.co.uk/>
> 
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/mapserver-users 
> <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] Creating a ZXY tileset via mapcache

2017-05-17 Thread Dave Barter
Can anyone help with this:-

https://gis.stackexchange.com/questions/240740/mapcache-template-or-grid-directive
 
<https://gis.stackexchange.com/questions/240740/mapcache-template-or-grid-directive>

Thanks

Dave Barter
d...@phased.co.uk
@citizenfishy
www.phased.co.uk

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