[Gfoss] pmapper su remoto
beppe
beppenapo a gmail.com
Mar 18 Nov 2008 12:38:11 CET
Salve a tutti,
risolti i problemi con l'aggiornamento dati in postgis modificando la
query prodotta da shp2pgsql, mi si è presentato un nuovo problema, anzi
2:
1. il progetto sulla lunigiana coordinato dal cdl di Informatica
Umanistica di Pisa prevede un webgis "storico-archeologico" sulla
lunigiana e la creazione di un database. Diversi laureandi della
triennale e della specialistica stanno collaborando a questo progetto
(la road map del progetto è su
http://iu.di.unipi.it/wiki/index.php/WebGIS_Lunigiana dove si presto si
spera di inserire anche il prototipo del webgis!).
Il processo d'installazione su una macchina fedora è stato fatto dal
sistemista su mie indicazioni (prese dall'ottimo sito di Niccolò
Rigacci); ma evidentemente qualcosa non è stato fatto:
quando punto al pmapper, vedo solo il codice della pagina!!!
Le cartelle tmp sono state create, i permessi cambiati e nel map file è
stato cambiato il loro percorso.
Forse manca qualche pacchetto?
2. ancora non sono riuscito a risolvere il problema della connessione a
postgis. Vi posto il codice:
#
# Start of map file
#
MAP
EXTENT 479.208028 503.450009 531.548844 535.691538 #500.223058
519.853510 506.734113 523.620023
UNITS meters
#EXTENT -15 30 40 70
#UNITS dd
SIZE 600 500
SHAPEPATH "../../../pmapper_demodata"
SYMBOLSET "../common/symbols/symbols-pmapper.sym"
FONTSET "../common/fonts/msfontset.txt"
RESOLUTION 96
IMAGETYPE png
INTERLACE OFF
#CONFIG "PROJ_LIB" "C:/proj/nad/"
PROJECTION
# ETRS-LAEA
#"init=epsg:4326"
"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
#"+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +units=m +no_defs no_defs"
END
#
# Image formates for GD
#
OUTPUTFORMAT
NAME "png"
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE RGB
FORMATOPTION INTERLACE=OFF
TRANSPARENT OFF
EXTENSION "png"
END
OUTPUTFORMAT
NAME "png8"
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
FORMATOPTION INTERLACE=OFF
TRANSPARENT OFF
EXTENSION "png"
END
OUTPUTFORMAT
NAME "jpeg"
DRIVER "GD/JPEG"
MIMETYPE "image/jpeg"
IMAGEMODE RGB
FORMATOPTION "QUALITY=70"
EXTENSION "jpg"
END
#
# Image formats for AGG
#
# OUTPUTFORMAT ### 24 bit PNG
# NAME 'agg_png'
# DRIVER AGG/PNG
# IMAGEMODE RGB
# END
# OUTPUTFORMAT ### 32 bit PNG with alpha channel from transparency
# NAME 'agg_pnga'
# DRIVER AGG/PNG
# IMAGEMODE RGBA
# END
# OUTPUTFORMAT ### 8 bit PNG
# NAME 'agg_png8'
# DRIVER AGG/PNG
# IMAGEMODE RGB
# FORMATOPTION "QUANTIZE_FORCE=ON"
# FORMATOPTION "QUANTIZE_DITHER=OFF"
# FORMATOPTION "QUANTIZE_COLORS=256"
# END
# OUTPUTFORMAT
# NAME 'agg_jpeg'
# DRIVER AGG/JPEG
# IMAGEMODE RGB
# END
OUTPUTFORMAT
NAME GTiff
DRIVER "GDAL/GTiff"
MIMETYPE "image/tiff"
IMAGEMODE RGB
#FORMATOPTION "TFW=YES"
#FORMATOPTION "COMPRESS=PACKBITS"
EXTENSION "tif"
END
OUTPUTFORMAT
NAME imagemap
MIMETYPE "text/html"
FORMATOPTION SKIPENDTAG=OFF
DRIVER imagemap
END
#
# Start of web interface definition
#
WEB
TEMPLATE "map.html"
IMAGEPATH "/var/www/tmp/"
IMAGEURL "/tmp/"
METADATA
#"MAPFILE_ENCODING" "ISO-8859-1"
"ows_title" "WMS Demo Server"
"ows_onlineresource" "http://wms.yourserver.org?owskey=test&"
"ows_srs" "EPSG:3035 EPSG:4326"
END # Metadata
END # Web
#
# Start of Reference map definition
#
REFERENCE
EXTENT 479.208028 503.450009 531.548844 535.691538 #500.223058
519.853510 506.734113 523.620023
IMAGE "../../images/reference.png"
SIZE 199 149
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END # Reference
LEGEND
END
#
# Start of ScaleBar definition
#
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
#================== START OF LAYER SECTION =====================#
LAYER
NAME 'basolato'
TYPE RASTER
DATA 'basolato.tif'
METADATA
'wms_title' 'basolato'
END
STATUS DEFAULT
TRANSPARENCY 100
PROJECTION
"init=epsg:4326"
END
END
#
#connessione postgis
#
LAYER
NAME 'sepolture'
TYPE LINE
CONNECTIONTYPE postgis
CONNECTION 'host=localhost port=5432 user=beppe password=xxxxxx
dbname=ssd'
DATA 'gis FROM public.sepoltura_singola USING SRID=4326 USING UNIQUE
id'
TEMPLATE void
DUMP true
METADATA
'wms_title' 'sepolture'
"RESULT_FIELDS" "id,sito_sigla,us"
"RESULT_HEADERS" "id,sito_sigla,us"
END
STATUS DEFAULT
TRANSPARENCY 100
PROJECTION
"init=epsg:4326"
END
CLASS
Name 'sepolture'
STYLE
SYMBOL 0
SIZE 3
OUTLINECOLOR 67 5 65
COLOR 0 0 0
END#stile
TEMPLATE void
END # Class
END
END #Map
dubbi: tutti i layer caricati (vettoriali e raster) sono referenziati
secondo un sistema relativo (x,y) e non assoluto (sigh!), può creare
problemi? Nel map file è indicata come proiezione la wgs84 alla quale si
riferise il codice epsg 4326. In teoria dovrebbe funzionare anche se
assegno una proiezione "inventata", o sbaglio?
In realtà il problema è di tutti i layer, non solo di quelli postgis: al
momento di caricare le immagini il "loading" va in palla!!!
Consigli?
Grazie mille
-beppe-
Maggiori informazioni sulla lista
Gfoss