Ola pessoal,
Possuo um banco de dados com 4 tabelas, 2 convencionais e 2 espaciais, contendo o meu mapa e os dados sobre ele. Também possui uma tabela com casos a ser estudado.
Criei alguns mapfile para carrega-lo no I3GEO mas cometi algum erro, pois nao carrega.
Gostaria que se possivel alguem me ajude a resolver este problema.
Já testei também uma consulta sql que preciso fazer no Postgres e ela funciona, gostaria de saber como utilizala no mapfile pois quando encontrar uma ocorrencia com o nome de bairro igual ao bairro do mapa deveria aparecer um ponto no bairro em questão.
O select criado foi : select centroid(b1.the_geom) as the_geom from bairros as b1, hepatite as b2 where b1.bairro = b2.bairros
O mapfile que possuo é o seguinnte:
MAP
NAME MyMap
# Map image size
SIZE 600 400
UNITS dd
EXTENT -17.795763 -9.577276 12.556183 9.639636
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
''
END
# Background color for the map canvas -- change as desired
IMAGECOLOR 255 255 255
IMAGEQUALITY 95
IMAGETYPE PNG
OUTPUTFORMAT
NAME 'PNG'
DRIVER 'GD/PNG'
MIMETYPE 'image/png'
#IMAGEMODE PC256
EXTENSION 'png'
END
# Legend
LEGEND
IMAGECOLOR 255 255 255
STATUS ON
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
END
# Web interface definition. Only the template parameter
# is required to display a map. See MapServer documentation
WEB
# Set IMAGEPATH to the path where MapServer should
# write its output.
IMAGEPATH '/tmp/'
# Set IMAGEURL to the url that points to IMAGEPATH
# as defined in your web server configuration
IMAGEURL '/tmp/'
# WMS server settings
METADATA
'wms_title' 'MyMap'
'wms_onlineresource' 'http://my.host.com/cgi-bin/mapserv?map=wms.map&'
'wms_srs' 'EPSG:4326'
END
#Scale range at which web interface will operate
# Template and header/footer settings
# Only the template parameter is required to display a map. See MapServer documentation
END
LAYER
NAME 'bairros'
TYPE POLYGON
CONNECTIONTYPE postgis
CONNECTION 'host=localhost user='postgres' password=postgres dbname='lagesalfa''
DATA 'the_geom FROM bairros'
METADATA
'wms_title' 'bairros'
END
STATUS DEFAULT
TRANSPARENCY 100
PROJECTION
'proj=longlat'
'ellps=WGS84'
'datum=WGS84'
'no_defs'
''
END
CLASS
NAME 'bairros'
STYLE
SYMBOL 0
SIZE 2
OUTLINECOLOR 0 0 0
COLOR 150 123 90
END
END
END
END
Agradeço desde já.
Giulianno Vaz
Autor: giulianno vaz

1Um comentário
espesificar la query de la sigiente manera DATA "the_geom FROM (SELECT campos1, campo2, ... campoX FROM mi_vista) as
mi_capa USING UNIQUE gid USING SRID = SRID_utilizado" 2009/9/14 > Forum: Geral - usuários e desenvolvedores
> Thread: Problema no mapfile
> Author: giulianno vaz
> Posted: 2009-09-14 12:25:11.83413-03
>
> Ola pessoal,
>
> Possuo um banco de dados com 4 tabelas, 2 convencionais e 2 espaciais,
> contendo o meu mapa e os dados sobre ele. Também possui uma tabela com casos
> a ser estudado.
>
> Criei alguns mapfile para carrega-lo no I3GEO mas cometi algum erro, pois
> nao carrega.
>
> Gostaria que se possivel alguem me ajude a resolver este problema.
>
> Já testei também uma consulta sql que preciso fazer no Postgres e ela
> funciona, gostaria de saber como utilizala no mapfile pois quando encontrar
> uma ocorrencia com o nome de bairro igual ao bairro do mapa deveria aparecer
> um ponto no bairro em questão.
>
> O select criado foi : select centroid(b1.the_geom) as the_geom from bairros
> as b1, hepatite as b2 where b1.bairro = b2.bairros
>
> O mapfile que possuo é o seguinnte:
>
> MAP
> NAME MyMap
> # Map image size
> SIZE 600 400
> UNITS dd
>
> EXTENT -17.795763 -9.577276 12.556183 9.639636
> PROJECTION
> 'proj=longlat'
> 'ellps=WGS84'
> 'datum=WGS84'
> 'no_defs'
> ''
> END
>
> # Background color for the map canvas -- change as desired
> IMAGECOLOR 255 255 255
> IMAGEQUALITY 95
> IMAGETYPE PNG
> OUTPUTFORMAT
> NAME 'PNG'
> DRIVER 'GD/PNG'
> MIMETYPE 'image/png'
> #IMAGEMODE PC256
> EXTENSION 'png'
> END
> # Legend
> LEGEND
> IMAGECOLOR 255 255 255
> STATUS ON
> KEYSIZE 18 12
> LABEL
> TYPE BITMAP
> SIZE MEDIUM
> COLOR 0 0 89
> END
> END
>
> # Web interface definition. Only the template parameter
> # is required to display a map. See MapServer documentation
> WEB
> # Set IMAGEPATH to the path where MapServer should
> # write its output.
> IMAGEPATH '/tmp/'
>
> # Set IMAGEURL to the url that points to IMAGEPATH
> # as defined in your web server configuration
> IMAGEURL '/tmp/'
>
> # WMS server settings
> METADATA
> 'wms_title' 'MyMap'
> 'wms_onlineresource' '
> my.host.com/cgi-bin/mapserv?map=wms.map&'
> 'wms_srs' 'EPSG:4326'
> END
>
> #Scale range at which web interface will operate
> # Template and header/footer settings
> # Only the template parameter is required to display a map. See
> MapServer documentation
> END
>
> LAYER
> NAME 'bairros'
> TYPE POLYGON
> CONNECTIONTYPE postgis
> CONNECTION 'host=localhost user='postgres' password=postgres
> dbname='lagesalfa''
> DATA 'the_geom FROM bairros'
> METADATA
> 'wms_title' 'bairros'
> END
> STATUS DEFAULT
> TRANSPARENCY 100
> PROJECTION
> 'proj=longlat'
> 'ellps=WGS84'
> 'datum=WGS84'
> 'no_defs'
> ''
> END
> CLASS
> NAME 'bairros'
> STYLE
> SYMBOL 0
> SIZE 2
> OUTLINECOLOR 0 0 0
> COLOR 150 123 90
> END
> END
> END
> END
>
>
>
> Agradeço desde já.
>
> Giulianno Vaz
>
> Recebendo correspondência demais? Gerencie suas notificações em:
> www.softwarepublico.gov.br/notifications/manage
> --
--------------------------------------------------------------
Moscardi Aldo M.
cel: 03752 15737975