[Featureserver] First steps
Christopher Schmidt
crschmidt at metacarta.com
Mon Nov 24 08:47:35 EST 2008
On Mon, Nov 24, 2008 at 02:43:16PM +0200, Lehtonen, Mika wrote:
> Hi Christopher,
> you're right. I had error in it. Now I got PostGis working, but shape
> says this:
>
> An error occurred: 'utf8' codec can't decode bytes in position 4-6: invalid
> data
>
> - mika -
>
> P.S. Here's the cfg.
> [shape]
> type=OGR
> dsn=/var/digikartta.net/Kunta3m_221008_region.shp
> layer=Kunta3m_221008_region
I guess your shapefile is in some non-UTF8 encoding, and has non ascii
characters? FeatureServer doesn't support this, I guess.
> Christopher Schmidt kirjoitti:
> >On Mon, Nov 24, 2008 at 12:05:38PM +0200, Lehtonen, Mika wrote:
> >
> >>Hi Bruno,
> >>I did that. Now I'm getting this:
> >>
> >>An error occurred: 'NoneType' object has no attribute 'GetLayerDefn'
> >>
> >
> >What does your config look like? It sounds ilke your config doesn't give
> >featureserver information to find a correct layer...
> >
> >
> >> File
> >> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py", line 264, in cgiHandler
> >> service = Server.load(*cfgfiles)
> >> File
> >> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py", line 69, in _load
> >> config, section, 'DataSource')
> >> File
> >> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py", line 49, in _loadFromSection
> >> return objclass(section, **objargs)
> >> File
> >> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/DataSource/OGR.py", line 58, in __init__
> >> self.defn = self.layer.GetLayerDefn()
> >>
> >>- mika -
> >>
> >>Brian Russo kirjoitti:
> >>
> >>>Check your that your ld.so.conf contains the directory where that
> >>>library is; or run ldconfig, etc.
> >>>
> >>>On Sun, Nov 23, 2008 at 11:00 PM, Lehtonen, Mika <mika at digikartta.net
> >>><mailto:mika at digikartta.net>> wrote:
> >>>
> >>> Hi again,
> >>>
> >>> I am still trying to take my first step with FeatureServer. I
> >>> built OGR
> >>> with Python bindings and it seemed to be succesfull (gdal 1.5.3) but,
> >>> now I get this:
> >>> An error occurred: libgdal.so.1: cannot open shared object file:
> >>> No such
> >>> file or directory File
> >>> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py
> >>> <http://digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py>",
> >>> line 264, in cgiHandler service = Server.load(*cfgfiles) File
> >>> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py
> >>> <http://digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py>",
> >>> line 69, in _load config, section, 'DataSource') File
> >>> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py
> >>> <http://digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/Server.py>",
> >>> line 43, in _loadFromSection module = __import__("%s.%s" %
> >>> (module_type,
> >>> type), globals(), locals(), type) File
> >>> "/var/digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/DataSource/OGR.py
> >>> <http://digikartta.net/cgi-bin/featureserver-1.12/FeatureServer/DataSource/OGR.py>",
> >>> line 14, in <module> import ogr File
> >>> "/usr/local/lib/python2.6/site-packages/ogr.py", line 2, in <module>
> >>> from osgeo.gdal import deprecation_warn File
> >>> "/usr/local/lib/python2.6/site-packages/osgeo/gdal.py", line 7, in
> >>> <module> import _gdal
> >>>
> >>> What's wrong with my configuration. Any ideas? Should I have used
> >>> some
> >>> other options also when building than '--with-python'?
> >>>
> >>> - mika -
> >>>
> >>> Lehtonen, Mika kirjoitti:
> >>> > Ok,
> >>> > I just lost three hours. If I edit featureserver.cgi through FTP
> >>> > (WinSCP), I got Internal Server Error. But that cgi is easy to
> >>> fix. I
> >>> > just open it into Linux editor and save it again. No more ISE!
> >>> >
> >>> > Hallelujah,
> >>> > - mika -
> >>> >
> >>> > Lehtonen, Mika kirjoitti:
> >>> >
> >>> >> Hi again,
> >>> >>
> >>> >> I have been now trying to get FeatureServer work in my own
> >>> server. I
> >>> >> followed the procedure that I used earlier; with which FS
> >>> worked except
> >>> >> the OGR was missing. Now I get 'Internal Server Error' and if I
> >>> check
> >>> >> the error log, there is said that: "(2)No such file or
> >>> directory: exec
> >>> >> of '....featureserver.cgi' failed and after that: "Premature end
> >>> of
> >>> >> script headers: featureserver.cgi".
> >>> >>
> >>> >> In this server I have Python 2.3.4 and the earlier one had
> >>> 2.4.x. Does
> >>> >> it have something to do with the error?
> >>> >>
> >>> >> Other CGI-scripts seem to be working in that directory.
> >>> >>
> >>> >> - mika -
> >>> >>
> >>> >> Lehtonen, Mika kirjoitti:
> >>> >>
> >>> >>
> >>> >>> Ok,
> >>> >>> I see, now I feel stupid. I tried to test FeatureServer in my
> >>> operator's
> >>> >>> server. They definitely don't have the ogr. Yeah, OS is anyway
> >>> Linux. I
> >>> >>> have to switch on to my own Centos server. Just been having some
> >>> >>> problems in installing/building Apache httpd.
> >>> >>>
> >>> >>> thanks,
> >>> >>> mika
> >>> >>>
> >>> >>> Josh Livni kirjoitti:
> >>> >>>
> >>> >>>
> >>> >>>
> >>> >>>> Mika,
> >>> >>>>
> >>> >>>> As the traceback notes: "An error occurred: No module named
> >>> ogr" So
> >>> >>>> the issue is you don't have OGR python bindings installed on
> >>> your
> >>> >>>> system, or at least not for the python being used by
> >>> featureserver.
> >>> >>>>
> >>> >>>> If you are running windows, there are some (slightly out of
> >>> date, but
> >>> >>>> probably functional) instructions
> >>> >>>> at
> >>> http://os.umbrellaconsulting.com/wiki/FeatureServerOnWindows that
> >>> >>>> might help you get started with a simple demo.
> >>> >>>>
> >>> >>>> If linux, I assume you should be ok figuring out how to
> >>> install ogr,
> >>> >>>> but if not write back with more info on your setup and your
> >>> attempted
> >>> >>>> steps/errors.
> >>> >>>>
> >>> >>>>
> >>> >>>> -Josh
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>>> On Thu, Nov 20, 2008 at 8:21 AM, Lehtonen, Mika
> >>> <mika at digikartta.net <mailto:mika at digikartta.net>
> >>> >>>> <mailto:mika at digikartta.net <mailto:mika at digikartta.net>>>
> >>> wrote:
> >>> >>>>
> >>> >>>> Hi,
> >>> >>>>
> >>> >>>> I've been trying to use FeatureServer for an hour now and
> >>> might have
> >>> >>>> something else to do. So I'm taking a short cut, if
> >>> someone can
> >>> >>>> help me.
> >>> >>>>
> >>> >>>> I have a web server with CGI, so I uploaded the
> >>> FeatureServer code in
> >>> >>>> there. I added the following into cfg-file:
> >>> >>>>
> >>> >>>> [shape]
> >>> >>>> type=OGR
> >>> >>>> dsn=/var/www/cgi-bin/featureserver-1.12/name-of-my-shape.shp
> >>> >>>> layer=myshape
> >>> >>>>
> >>> >>>> But I am getting this, when trying to call the
> >>> featureserver.cgi
> >>> >>>>
> >>> >>>> An error occurred: No module named ogr
> >>> >>>> File
> >>> >>>>
> >>> "/var/www/cgi-bin/featureserver-1.12/FeatureServer/Server.py",
> >>> >>>> line 264, in cgiHandler
> >>> >>>> service = Server.load(*cfgfiles)
> >>> >>>> File
> >>> >>>>
> >>> "/var/www/cgi-bin/featureserver-1.12/FeatureServer/Server.py",
> >>> >>>> line 68, in _load
> >>> >>>> datasources[section] = cls.loadFromSection(
> >>> >>>> File
> >>> >>>>
> >>> "/var/www/cgi-bin/featureserver-1.12/FeatureServer/Server.py",
> >>> >>>> line 43, in _loadFromSection
> >>> >>>> module = __import__("%s.%s" % (module_type, type),
> >>> globals(),
> >>> >>>> locals(), type)
> >>> >>>> File
> >>> >>>>
> >>> "/var/www/cgi-bin/featureserver-1.12/FeatureServer/DataSource/OGR.py",
> >>> >>>> line 14, in ?
> >>> >>>> import ogr
> >>> >>>>
> >>> >>>> If I remove that [shape], I get this:
> >>> >>>>
> >>> >>>> {"Layers": []}
> >>> >>>>
> >>> >>>> So, what's wrong?
> >>> >>>>
> >>> >>>> - mika -
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>>> _______________________________________________
> >>> >>>> Featureserver mailing list
> >>> >>>> Featureserver at openlayers.org
> >>> <mailto:Featureserver at openlayers.org>
> >>> <mailto:Featureserver at openlayers.org
> >>> <mailto:Featureserver at openlayers.org>>
> >>> >>>> http://featureserver.org/mailman/listinfo/featureserver
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>>>
> >>> >>> _______________________________________________
> >>> >>> Featureserver mailing list
> >>> >>> Featureserver at openlayers.org
> >>> <mailto:Featureserver at openlayers.org>
> >>> >>> http://featureserver.org/mailman/listinfo/featureserver
> >>> >>>
> >>> >>>
> >>> >>>
> >>> >> _______________________________________________
> >>> >> Featureserver mailing list
> >>> >> Featureserver at openlayers.org <mailto:Featureserver at openlayers.org>
> >>> >> http://featureserver.org/mailman/listinfo/featureserver
> >>> >>
> >>> >>
> >>> > _______________________________________________
> >>> > Featureserver mailing list
> >>> > Featureserver at openlayers.org <mailto:Featureserver at openlayers.org>
> >>> > http://featureserver.org/mailman/listinfo/featureserver
> >>> >
> >>> _______________________________________________
> >>> Featureserver mailing list
> >>> Featureserver at openlayers.org <mailto:Featureserver at openlayers.org>
> >>> http://featureserver.org/mailman/listinfo/featureserver
> >>>
> >>>
> >>>
> >>_______________________________________________
> >>Featureserver mailing list
> >>Featureserver at openlayers.org
> >>http://featureserver.org/mailman/listinfo/featureserver
> >>
> >
> >
--
Christopher Schmidt
MetaCarta
More information about the Featureserver
mailing list