place a point in the map
N M
mapserver at HOTMAIL.COM
Wed Jul 13 00:23:26 PDT 2005
Hi David,
I know I'm doing something wrong but I don't know what.
I created my DSN link named mapa21 to my database file with controller
Microsoft Text Driver (*.txt; *.cvs) (I think it is the correct one)
My database file mapa21.txt contains:
unknown,na,id,id2,mark,coalkey,coalkey2,long,lat
0.000,0.000,1,1,7,87,87,76.90238,51.07161
0.000,0.000,2,2,7,110,110,78.53851,50.69403
0.000,0.000,3,3,3,112,112,83.22586,71.24420
0.000,0.000,4,4,6,114,114,80.79896,73.41175
My file mapa21.ovf is:
<OGRVRTDataSource>
<OGRVRTLayer name="mapa21">
<SrcDataSource>ODBC:mapa21</SrcDataSource>
<SrcLayer>mapa21.txt</SrcLayer>
<GeometryField encoding="PointFromColumns" x="Long" y="Lat"/>
<GeometryType>wkbPoint</GeometryType>
</OGRVRTLayer>
</OGRVRTDataSource>
Then I execute ogrinfo d:\webserver\mapserver2\mapa21.ovf -so
And the result is:
ERROR 4: Update access not supported for VRT datasources.
ERROR 1: Unable to identify source X or Y field for PointFromColumns
encoding.
FAILURE:
Unable to open datasource `d:\webserver\mapserver2\mapa21.ovf' with the
following drivers.
-> ESRI Shapefile
-> UK .NTF
-> SDTS
-> TIGER
-> S57
-> MapInfo File
-> DGN
-> VRT
-> AVCBin
-> REC
-> Memory
-> CSV
-> GML
-> SQLite
-> ODBC
-> OGDI
-> PostgreSQL
-> FMEObjects Gateway
What am I doing wrong?
Thank you for your help.
Nuri
>
>To answer my own question, OGRINFO will return an extent from a VRT ODBC
>connection.
>
>I used this command in the FWTools shell:
>
>C:\Program Files\FWTools0.9.6>ogrinfo c:\maps\vrttest\facilities.ovf
>facilities -so
>
>(the -so option provides 'summary only', adding a -ro would open the data
>in 'read only' mode and prevent the 'Error 4: Update access not
>supported...' message)
>
>Here is the data that I got back:
>
>ERROR 4: Update access not supported for VRT datasources.
>Had to open data source read-only.
>INFO: Open of `c:\cfusionmx\wwwroot\maps\vrttest\facilities.ovf'
>using driver `VRT' successful.
>
>Layer name: facilities
>Geometry: Point
>Feature Count: 91
>Extent: (0.000000, 0.000000) - (659989.000000, 5410447.000000)
>Layer SRS WKT:
>PROJCS["WGS 84 / UTM zone 15N",
> GEOGCS["WGS 84",
> DATUM["WGS_1984",
> SPHEROID["WGS 84",6378137,298.257223563,
> AUTHORITY["EPSG","7030"]],
> AUTHORITY["EPSG","6326"]],
> PRIMEM["Greenwich",0,
> AUTHORITY["EPSG","8901"]],
> UNIT["degree",0.01745329251994328,
> AUTHORITY["EPSG","9122"]],
> AUTHORITY["EPSG","4326"]],
> PROJECTION["Transverse_Mercator"],
> PARAMETER["latitude_of_origin",0],
> PARAMETER["central_meridian",-93],
> PARAMETER["scale_factor",0.9996],
> PARAMETER["false_easting",500000],
> PARAMETER["false_northing",0],
> UNIT["metre",1,
> AUTHORITY["EPSG","9001"]],
> AUTHORITY["EPSG","32615"]]
>DestFacID: String (8.0)
>DestFac: String (50.0)
>DestFacType: String (20.0)
>
>OGRINFO documentation can be found at
>http://www.remotesensing.org/gdal/ogr/ogrinfo.html
>
>FWTools Suite can be found at: http://fwtools.maptools.org/
>
>Hope this helps.
>
>David.
>
>
>David Fawcett
>Minnesota Office of Environmental Assistance
>david.fawcett at moea.state.mn.us
>651.215.0200
>
>
>-----Original Message-----
>From: Fawcett, David
>Sent: Tuesday, July 12, 2005 8:39 AM
>To: 'N M'; MAPSERVER-USERS at lists.umn.edu
>Subject: RE: [UMN_MAPSERVER-USERS] place a point in the map
>
>
>The EXTENT line in the MAP object sets the initial extent of your map when
>you start your application. How do you want your map to look when you
>start up? Do you want it to show the full extent of your background
>raster? If so, use that extent.
>
>Just make sure that UNITS matches the units used by your projection, and
>that either both layers are in the same projection, OR add projection
>information so that you can display both layers at the same time.
>
>I don't have a virtual data layer handy, so I can't quickly test it, but
>does anyone know if running ogrinfo on a text data source will return the
>extent?
>
>David.
>
>David Fawcett
>Minnesota Office of Environmental Assistance
>david.fawcett at moea.state.mn.us
>651.215.0200
>
>
>-----Original Message-----
>From: N M [mailto:mapserver at hotmail.com]
>Sent: Tuesday, July 12, 2005 6:13 AM
>To: David.Fawcett at state.mn.us; MAPSERVER-USERS at lists.umn.edu
>Subject: Re: [UMN_MAPSERVER-USERS] place a point in the map
>
>
>
>Hi David,
>
>I follow all steps in the information on the URL you send me, I think that
>DSN runs perfectly, I created the TXT database, the OVF file and I modifed
>my .map file with the parameters of the example. My question now is, how
>can
>I calculate the EXTENT coordinates. When I had a shapefile I used it to do
>it. Which could be my .map file so I could display it?
>
>Have I to change anything in my .map file so it runs? My EXTEND is the one
>of my old shapefile. Thank you
>
>MAP
> IMAGETYPE PNG
> EXTENT 0.000000 -205.000000 300.000000 0.000000
> SIZE 585 400
> SHAPEPATH "data"
> IMAGECOLOR 255 180 0
>
> #PROJECTION
> # "proj=laea"
> # "ellps=clrk66"
> # "lat_0=45"
> # "lon_0=-100"
> #
> # Alternatively, you can specify an EPSG code.
> # "init=epsg:2163"
> #
> #END
>
> # Start of LAYER DEFINITIONS
>---------------------------------------------
>
> LAYER # Capa de raster
> NAME mapafig
> DATA "raster/figueres.tif"
> STATUS DEFAULT
> TYPE RASTER
> PROCESSING "BANDS=1"
>
>
> #OFFSITE 71 74 65 #Color que ha de ser transparent
>
> #PROJECTION
> # "init=epsg:4326"
> #END
> END # Fi capa de raster
>
>
>LAYER
> CONNECTION "mapa21.ovf"
> CONNECTIONTYPE OGR
> DATA "prova"
> METADATA
> "wms_srs" "4326"
> "wms_title" "prova"
> END
> NAME "prova"
> SIZEUNITS PIXELS
> STATUS ON
> TOLERANCE 0
> TOLERANCEUNITS PIXELS
> TYPE POINT
> UNITS METERS
> CLASS
> STYLE
> COLOR 0 0 0
> MAXSIZE 100
> MINSIZE 1
> SIZE 6
> SYMBOL "symbols/prova.gif"
> END
> END
> END
>
>
>
> # End of LAYER DEFINITIONS -------------------------------
>END # end of map file
>
> >If you don't want to place your data in ESRI shapefiles or a database,
>you
> >can use a simple text file as the data source for a layer.
> >
> >If your Mapserver binary has been compiled with OGR support (quite
>likely),
> >you can use a virtual data source. Take a look at the Vector Data Access
> >Reference
> >http://ms.gis.umn.edu:8081/ms_plone/docs/reference/vector_data/VirtualSpatialData
> >
> >If you search the list archives for OGR and VRT, you will most likely
>find
> >some example map file layers.
> >
> >David.
> >
> >David Fawcett
> >Minnesota Office of Environmental Assistance
> >david.fawcett at moea.state.mn.us
> >651.215.0200
> >
> >
> >-----Original Message-----
> >From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
> >Behalf Of SUBSCRIBE MAPSERVER-USERS Nuri
> >Sent: Monday, July 11, 2005 4:52 AM
> >To: MAPSERVER-USERS at LISTS.UMN.EDU
> >Subject: [UMN_MAPSERVER-USERS] place a point in the map
> >
> >
> >Recently I managed to create my own map and placed a symbol in it from a
> >database.
> >
> >Now I need to place several points in the map. My database contains gps
> >coordinates like this:
> >
> >4216 9669 259
> >
> >Latitude: 42º 16'N
> >Longitude: 258ºE
> >
> >I translated this gps coordinates to UTM coordinates to obtain:
> >
> >Zone: 14
> >Easting: 252608
> >Norting: 4683531
> >
> >I need to show this point in the map.
> >
> >Someone could explain my how to do it? Thank you.
> >
> >My present .map file is:
> >
> >MAP
> > IMAGETYPE PNG
> > EXTENT 0.000000 -205.000000 300.000000 0.000000
> > SIZE 600 410
> > SHAPEPATH "data"
> > IMAGECOLOR 255 180 0
> > FONTSET "fonts/fonts.list"
> >
> > #PROJECTION
> > # "proj=laea"
> > # "ellps=clrk66"
> > # "lat_0=45"
> > # "lon_0=-100"
> > #
> > # Alternatively, you can specify an EPSG code.
> > # "init=epsg:2163"
> > #
> > #END
> >
> > # Start of LAYER DEFINITIONS
> >--------------------------------------------
> >-
> >
> > LAYER # Capa de raster
> > NAME mapafig
> > DATA "raster/figueres.tif"
> > STATUS DEFAULT
> > TYPE RASTER
> > PROCESSING "BANDS=1"
> > #OFFSITE 71 74 65 #Color que ha de ser transparent
> >
> > #PROJECTION
> > # "init=epsg:4326"
> > #END
> > END # Fi capa de raster
> >
> >
> >
> > LAYER
> > NAME simbols
> > GROUP grup
> > STATUS DEFAULT
> > DATA mapa
> > TYPE ANNOTATION
> > LABELITEM "SIMB"
> > CLASSITEM "C"
> > CLASS
> > EXPRESSION "2"
> > STYLE
> > COLOR 0 0 0 # dummy color
> > SYMBOL 'symbols/prova.gif'
> > END
> > LABEL
> > MINFEATURESIZE 20
> > MINDISTANCE 50
> > POSITION CC
> > SIZE TINY
> > COLOR 255 255 255
> > END
> > END
> >
> > PROJECTION
> > "init=epsg:4326"
> > END
> > END
> >
> >
> >
> > # End of LAYER DEFINITIONS -------------------------------
> >END # end of map file
>
>_________________________________________________________________
>Descarga gratis la Barra de Herramientas de MSN
>http://www.msn.es/usuario/busqueda/barra?XAPID=2031&DI=1055&SU=http%3A//www.hotmail.com&HL=LINKTAG1OPENINGTEXT_MSNBH
_________________________________________________________________
Acepta el reto MSN Premium: Correos más divertidos con fotos y textos
increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis.
http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos
More information about the MapServer-users
mailing list