[OpenLayers-Users] WFS, what EPSG use???

Andreas Hocevar ahocevar at opengeo.org
Thu Oct 29 11:32:53 EDT 2009


Hi,

looking at 
http://www.aplicanet.gob.mx:8080/geoserver/wfs?version=1.0.0&request=GetFeature&typename=sde:DTYT.SSC_RUTAS_2009&maxfeatures=10 
I see that your native SRS is EPSG:32614.

Also, it seems you want your base layer in EPSG:900913. But your 
setCenter is in EPSG:4326, and your map also is.

Why don't you use Layer.Vector with a BBOX strategy and a WFS protocol? 
Layer.WFS is a bit old school. Look at 
http://www.openlayers.org/dev/examples/wfs-protocol.html for an example.

Your config should look like this:

    var layer = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url:  "http://www.aplicanet.gob.mx:8080/geoserver/wfs",
            featureType: "DTYT.SSC_RUTAS_2009",
            featureNS: "http://geoserver.sf.net",
            version: "1.1.0",
            srsName: "EPSG:4326"
        })
    });

Regards,
Andreas.


Arturo Juárez Lima wrote:
> sure,
>
> this is my page and code
>
> /<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "DTD/xhtml1-strict.dtd">/
> /<html xmlns="http://www.w3.org/1999/xhtml">/
> /<head>/
> / <title>Prueba 1a</title>/
> /</head>/
> / <script 
> src="http://172.16.23.21:8080/geoserver/openlayers/OpenLayers.js" 
> type="text/javascript">/
> /        </script>/
>
>
> /<body BGCOLOR=#CCCC98 onload="load();">/
>
> /<div id="map" style="width: 800px; height: 500px; top:-3px; 
> left:-350px; border: 9px solid #EBE9D4;"></div>/
>
> /<script type="text/javascript">/
> /function load() {/
> / format = 'image/png';/
> / var options = {/
> / /
> /                controls:[/
> / new OpenLayers.Control.Navigation(),/
> / new OpenLayers.Control.PanZoomBar(),/
> / new OpenLayers.Control.LayerSwitcher({'ascending':false}),/
> / new OpenLayers.Control.ScaleLine(),/
> / new OpenLayers.Control.MousePosition(),/
> / new OpenLayers.Control.KeyboardDefaults() ],/
> / numZoomLevels: 31,units: 'm' };/
> / var map = new OpenLayers.Map("map", options);/
>
> / l1 = new OpenLayers.Layer.WMS(/
> /                    'Limites', 
> "http://www.aplicanet.gob.mx:8080/geoserver/wms",/
> /                    {layers: 'sde:SPF_CATASTRO.LMA',/
> /                        srs: 'EPSG:900913',/
> / transparent: true,/
> /                        format: format,/
> /                        tiled: 'true'/
> /                    },{singleTile: true, isBaseLayer: true});/
> / l1.setVisibility(true); /
> /        map.addLayer(l1);/
>
> / var layer2 = new OpenLayers.Layer.WFS( /
> /                'CEC', "http://www.aplicanet.gob.mx:8080/geoserver/wfs",/
> /                {typename: 'sde:DTYT.SSC_RUTAS_2009',maxfeatures: 10}, /
> /                { featureClass: OpenLayers.Feature.WFS}); /
> /            map.addLayer(layer2);/
> /map.setCenter(new 
> OpenLayers.LonLat(-99.854736328125,20.80875529543977), 9); /
>
> /}/
> /</script>/
>
> /</body>/
> /</html>/
>
>
> hopefully you can help me
>
> Thanks.
>
>
> -- 
> Arturo Juárez Lima <ajuarez at queretaro.gob.mx 
> <mailto:ajuarez at queretaro.gob.mx>>
> GEQ
>
>
>
> El jue, 29-10-2009 a las 14:26 +0100, Andreas Hocevar escribió:
>> It is hard to guess your guess when you don't provide code. Please 
>> provide a code snippet and explain what does not work and what you don't 
>> understand.
>>
>> Regards,
>> Andreas.
>>
>> Arturo Juárez Lima wrote:
>> > Thanks Andreas, I was make question because I am trying add to a shape 
>> > in format WFS with openlayers, but I can't show my shape in my map, 
>> > then, I was guess, that maybe when I use a shape in WFS, maybe have a 
>> > EPSG in special. But you tell me that my guess is incorrect, then my 
>> > option are falling.
>> >
>> > could you give me a another guess, please :-)???
>> >
>> > thanks
>> > -- 
>> > Arturo Juárez Lima <ajuarez at queretaro.gob.mx <mailto:ajuarez at queretaro.gob.mx> 
>> > <mailto:ajuarez at queretaro.gob.mx>>
>> > GEQ
>> >
>> >
>> >
>> > El jue, 29-10-2009 a las 08:05 +0100, Andreas Hocevar escribió:
>> >> was that meant for geoserver-users? You sent it to the OpenLayers
>> >> users list. 
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at openlayers.org <mailto:Users at openlayers.org>
>> > http://openlayers.org/mailman/listinfo/users
>> >   
>>
>>
>>     
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list