[TinyOWS-users] Problem with using MapServer mapfile

Dejan Gambin dejan.gambin at coin.hr
Wed Jun 8 01:34:59 EST 2011


I did all you wrote and here are the results. But few notes before:

1. Didn't say but I am running all this on my Mac, so no on Linux machine. This might be important for you :D

2. Just for the test, I have tried tinyows --check (with TINYOWS_MAPFILE previously set) and I get "start-condition stack underflow" message. I don't get this with tinyows from 1.0-RC3

Anyway, here are the results:

tinyows dgambin$ ./test/unit_test queryfile 4
State: {0} 1 
State: {1} 19 
State: {0} 1 
State: {1} 24 
State: {0} 1 
State: {1} 24 
State: {0} 1 
State: {1} 2 
State: {2} 3 
State: {1} 2 
State: {0} 1 
State: {1} 23 
State: {0} 1 
State: {1} 22 
State: {0} 1 
State: {1} 21 
State: {21} 18 
State: {1} 21 
State: {21} 18 
State: {1} 21 
State: {0} 1 
State: {0} 0 
Content-Type: application/xml

<?xml version='1.0' encoding='UTF-8'?>
<ows:ExceptionReport
 xmlns='http://www.opengis.net/ows'
 xmlns:ows='http://www.opengis.net/ows'
 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
 xsi:schemaLocation='http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd'
 version='1.1.0' language='en'>
 <ows:Exception exceptionCode='ErrorConfigFile' locator='parse_config_file'>
  <ows:ExceptionText>MapFile Parse Error</ows:ExceptionText>
 </ows:Exception>
</ows:ExceptionReport>

MAPFILE:

MAP
NAME WMS_DEMO
#DEBUG 3
#CONFIG "MS_ERRORFILE" "/tmp/mapserver.log"
#CONFIG "ON_MISSING_DATA" "LOG"
#CONFIG "CPL_DEBUG" "ON"
#CONFIG "PROJ_DEBUG" "ON"
#CONFIG "PROJ_LIB" "/usr/share/proj/"
IMAGECOLOR 128 128 128

# Extent Vodnjan
EXTENT 5400700.000000 4972210.000000 5415590.000000 4989000.000000

 
UNITS meters
SIZE 600 500
MAXSIZE 10000
SHAPEPATH "../../../data/vodnjan/"
# SYMBOLSET "../common/symbols/symbols-pmapper.sym"
FONTSET "../common/fonts/msfontset.txt"
RESOLUTION 96
IMAGETYPE png
INTERLACE OFF
PROJECTION
 "init=epsg:31275"
END  



OUTPUTFORMAT
  NAME png
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE RGB
#  FORMATOPTION  INTERLACE=OFF
#  TRANSPARENT ON
END

OUTPUTFORMAT
  NAME png8
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE PC256
  FORMATOPTION  INTERLACE=OFF
  TRANSPARENT OFF
END

#
# Start of web interface definition
#
WEB
  TEMPLATE "map.html"
  IMAGEPATH "../../../tmp/"
  IMAGEURL "/tmp/"
  METADATA
    "MAPFILE_ENCODING" "WINDOWS-1250"
    "wms_title" "WMS Demo Server"
    "wms_online_resource" "http://localhost/cgi-bin/mywms?"
    "wms_srs" "EPSG:31275 EPSG:4326 EPSG:4269"
	"tinyows_schema_dir" "/usr/local/tinyows/schema/"
	"tinyows_onlineresource" "http://localhost/cgi-bin/mytinyows"
	"tinyows_check_schema" "0"
	"wfs_title" "TinyOWS service provided by a MapFile"
	"wfs_namespace_prefix" "coin"
	"wfs_namespace_uri" "http://www.coin.hr"
    "wfs_online_resource" "http://localhost/cgi-bin/mywfs?"
    "wfs_srs" "EPSG:31275 EPSG:4326 EPSG:4269"    
  END

END  # Web

#
# Start of Reference map definition
#
REFERENCE
EXTENT 5393461.38182 4972210 5422828.61818 4989000
  IMAGE "../../images/vodnjan_ref.png"
  SIZE 186 101
  COLOR -1 -1 -1
  OUTLINECOLOR 255 0 0
END  # Reference

LEGEND
END

#
# Start of ScaleBar definition
#maknuto
SCALEBAR
  STATUS off
  TRANSPARENT off
  INTERVALS 4
  SIZE 200 3
  UNITS kilometers
  COLOR 250 250 250
  OUTLINECOLOR 0 0 0
  BACKGROUNDCOLOR 100 100 100
  STYLE 0
  POSTLABELCACHE true
  LABEL
    COLOR 0 0 90
    #OUTLINECOLOR 200 200 200
    SIZE small
  END  # Label
END  # Reference

# SYMBOLS USED IN PMAPPER
# - 'circle' always necessary (used e.g. for highlight)
# - 'square' used in currecnt map file
# Symbols can also be defined via tag SYMBOLSET (see above)

SYMBOL
  Name 'circle'
  Type ELLIPSE
  Filled TRUE
  Points
    1 1
  END
END 

SYMBOL
  NAME 'square'
  TYPE VECTOR
  FILLED TRUE
  POINTS
    0 1
    0 0
    1 0
    1 1
    0 1
  END
END

SYMBOL
  NAME 'dashed'
  TYPE ELLIPSE
  POINTS 
  	1 1 
  END
  FILLED true
  PATTERN 10 5 5 10 END
END

SYMBOL
  NAME "cross"
  TYPE vector
  POINTS
    2 0
    2 4
    -99 -99
    0 2
    4 2
  END 
END

SYMBOL
  NAME "cross2"
  TYPE vector
  POINTS
    3 0
    3 6
    -99 -99
    0 3
    6 3
  END
END

SYMBOL
  NAME "cross3"
  TYPE vector
  POINTS
    4 0
    4 8
    -99 -99
    0 4
    8 4
  END
END

SYMBOL
  NAME "cross4"
  TYPE vector
  POINTS
    5 0
    5 10
    -99 -99
    0 5
    10 5
  END
END

SYMBOL
  NAME "cross45"
  TYPE vector
  POINTS
    0 0
    1 1
    -99 -99
    0 1
    1 0
  END 
END
 
SYMBOL
  NAME "fillcross"
  TYPE vector
  POINTS
    0 0
    5 5
    -99 -99
    0 5
    5 0
  END
END

SYMBOL
    NAME 'fill135'
    TYPE VECTOR
    POINTS
      0 0
      2 2
    END
END


SYMBOL
  NAME "line"
  TYPE vector
  POINTS
    0 2
    4 2
  END
END

SYMBOL
  NAME "vertical_line"
  TYPE vector
  POINTS
    2 0
    2 4
  END
END

SYMBOL
  NAME "triangle"
  TYPE vector
  POINTS
    0 4
    2 0
    4 4
    0 4
  END
  FILLED TRUE
END

### PODLOGE
###

LAYER # ortofoto
  NAME         "ortofoto"
  TYPE         RASTER
#  STATUS DEFAULT
  GROUP "ortofoto"
#  PROCESSING "OVERSAMPLE_RATIO=1"  
	PROJECTION
	  "init=epsg:31275"
	END  
  METADATA 
    "DESCRIPTION" "Ortofoto"
    "wms_title" "ortofoto"
    "wms_group_title" "ortofoto_group"
    "wms_srs" "EPSG:31275"
  END
  TILEINDEX "ortofoto_index"
  TILEITEM "LOCATION"
#  DEBUG 5
END 

LAYER # katastar vodnjan poligoni
  NAME "katastar"
#  DEBUG 5
  CONNECTIONTYPE POSTGIS
  CONNECTION "host=localhost dbname=vodnjan user=postgres password=postgres port=5432"
  DATA "the_geom from (select (katastar_postgis.gid*10000+katastar_vodnjan.id) as guid, katastar_postgis.the_geom, katastar_postgis.kc_broj, katastar_postgis.vlasnistvo, katastar_vodnjan.naziv_vlasnika, katastar_vodnjan.naziv_kulture, katastar_vodnjan.broj_pl, katastar_vodnjan.omjer_vlasnistva from katastar_postgis join katastar_vodnjan on katastar_postgis.ko_kc = katastar_vodnjan.broj_ko_kc) as subquery using unique guid srid=31275"
#  DATA "katastar_postgis"
  TYPE POLYGON  
#  DATA "kc_medja_peroj"  
#  TYPE LINE       
  GROUP "vlasnicka_karta"
  METADATA 
    "DESCRIPTION" "Katastar"
    "wms_title" "katastar"
    "wms_group_title" "katastar_group"
    "wms_srs" "EPSG:31275"    
	"wfs_title" "katastar"
	"wfs_namespace_prefix" "coin"
	"wfs_namespace_uri" "http://www.coin.hr"
	"wfs_srs" "EPSG:31275" 
	"tinyows_table"  "katastar_postgis"
	"tinyows_writable" "1"
	"tinyows_retrievable" "1"    
	"wfs_abstract" "WFS Abstract"
#	"wfs_featureid" "gid"
  END
  CLASSITEM 'vlasnistvo'
  LABELITEM "kc_broj"
  LABELMAXSCALEDENOM 14000
  CLASS
    Name 'KERMAS'
    EXPRESSION 'KERMAS'
    OUTLINECOLOR 0 0 0
    COLOR 250 0 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'PRIVATNO'
    EXPRESSION 'PRIVATNO'
    OUTLINECOLOR 0 0 0
    COLOR 0 250 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'RH'
    EXPRESSION 'RH'
    OUTLINECOLOR 0 0 0
    COLOR 0 0 250
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'EMAC'
    EXPRESSION 'EMAC'
    OUTLINECOLOR 0 0 0
    COLOR 0 250 250
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'JLS'
    EXPRESSION 'JLS'
    OUTLINECOLOR 0 0 0
    COLOR 250 250 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'JAVNO DOBRO'
    EXPRESSION 'JAVNO DOBRO'
    OUTLINECOLOR 0 0 0
    COLOR 250 0 250
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'POMORSKO DOBRO'
    EXPRESSION 'POMORSKO DOBRO'
    OUTLINECOLOR 0 0 0
    COLOR 150 150 150
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'AGROPRODUKT'
    EXPRESSION 'AGROPRODUKT'
    OUTLINECOLOR 0 0 0
    COLOR 250 70 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'G.U.'
    EXPRESSION 'G.U.'
    OUTLINECOLOR 0 0 0
    COLOR 120 60 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'NEPOZNATO'
    EXPRESSION 'NEPOZNATO'
    OUTLINECOLOR 0 0 0
    COLOR 200 200 200
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END  
  TRANSPARENCY 70
  DUMP TRUE
END 

LAYER # katastar vodnjan poligoni
  NAME "katastar_shape"
  DATA "katastar_postgis"
  TYPE POLYGON  
  METADATA 
    "DESCRIPTION" "Katastar Shape"
    "wms_title" "katastar_shape"
    "wms_group_title" "katastar_group"
    "wms_srs" "EPSG:31275"    
  END
  CLASSITEM 'VLASNISTV2'
  LABELITEM "KC_BROJ"
  LABELMAXSCALEDENOM 14000
  CLASS
    Name 'KERMAS'
    EXPRESSION 'KERMAS'
    OUTLINECOLOR 0 0 0
    COLOR 250 0 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'PRIVATNO'
    EXPRESSION 'PRIVATNO'
    OUTLINECOLOR 0 0 0
    COLOR 0 250 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'RH'
    EXPRESSION 'RH'
    OUTLINECOLOR 0 0 0
    COLOR 0 0 250
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'GRUPA 1'
    EXPRESSION 'EMAC'
    OUTLINECOLOR 0 0 0
    COLOR 0 250 250
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'JLS'
    EXPRESSION 'JLS'
    OUTLINECOLOR 0 0 0
    COLOR 250 250 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'JAVNO DOBRO'
    EXPRESSION 'JAVNO DOBRO'
    OUTLINECOLOR 0 0 0
    COLOR 250 0 250
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'POMORSKO DOBRO'
    EXPRESSION 'POMORSKO DOBRO'
    OUTLINECOLOR 0 0 0
    COLOR 150 150 150
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'GRUPA 3'
    EXPRESSION 'AGROPRODUKT'
    OUTLINECOLOR 0 0 0
    COLOR 250 70 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'GRUPA 2'
    EXPRESSION 'G.U.'
    OUTLINECOLOR 0 0 0
    COLOR 120 60 0
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END
  CLASS
    Name 'NEPOZNATO'
    EXPRESSION 'NEPOZNATO'
    OUTLINECOLOR 0 0 0
    COLOR 200 200 200
    LABEL
      POSITION cc
      COLOR 0 0 0 
      BUFFER 2
      TYPE truetype
      FONT FreeSans
      MINSIZE 6
      SIZE 6
      MAXSIZE 10
    END    
    TEMPLATE void
  END  
  TRANSPARENCY 70
END  

END  #Map

regards, dejan
On 7. lip. 2011., at 13:50, Olivier Courtin wrote:

> 
> On Jun 7, 2011, at 1:07 PM, Dejan Gambin wrote:
> 
>> Take this for example:
>> 
>> SCALEBAR
>> STATUS off
>> TRANSPARENT off
>> INTERVALS 4
>> SIZE 200 3
>> UNITS kilometers
>> COLOR 250 250 250
>> OUTLINECOLOR 0 0 0
>> BACKGROUNDCOLOR 100 100 100
>> STYLE 0
>> POSTLABELCACHE true
>> LABEL
>>   COLOR 0 0 90
>>   #OUTLINECOLOR 200 200 200
>>   SIZE small
>> END  # Label
>> END  # Reference
> 
> It's not something enough to explain the problem,
> 
> Could you:
> 
> - Get a fresh svn copy of TinyOWS
> 
> - Modify line 16 from src/mapfile/mapfile.l and put #if 0 to #if 1    
> (mapfile parser debug statement)
> 
> - Then launch:
> autoconf
> ./configure
> make flex
> make
> 
> (set your TINYOWS_MAPFILE envars if needed)
> 
> Put a basic query in a file, for instance:
> SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.1.0
> 
> then launch test/unit_test YOUR_FILE 4
> and send the whole result here. (with you whole mapfile too)
> 
> 
> Tks in advance,
> 
> 
> --
> Olivier
> 
> _______________________________________________
> TinyOWS-users mailing list
> TinyOWS-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tinyows-users



More information about the TinyOWS-users mailing list