Re: [Qgis-user] S57 map files

2009-01-18 Thread Chris h
On Sunday 18 January 2009 17:25:05 Florian El Ahdab wrote:

> Chris: The S52 implementation will obviously be the next step. Thank you
> for all this information (I had no idea the S52 was actually already coded
> somewhere... That's good news!)

Thanks for the compliment but passing on information as received from Hamish 
on the gpsdrive list. He's one of the developers driving the nautical 
component. I'm just testing stuff as it comes down the pipe but glad to beof 
help as such a pluggin would be very very practical. Pls allow me to 
encourage you. 

Best regards and thanks

-- 
/ch
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] S57 map files

2009-01-18 Thread Florian El Ahdab
Thank you to both of you for your very valuable inputs.

I've browsed the ogrprovider code and found how to implement your proposal.
Although I still haven't modified anything, I've made a few tries that seem
encouraging.

Martin: I am hoping to reach an acceptable solution for opening S57 layers
on demand soon. I will also have to set up svn to produce the actual patch
appropriately.

Chris: The S52 implementation will obviously be the next step. Thank you for
all this information (I had no idea the S52 was actually already coded
somewhere... That's good news!)

See you soon.
Florian

On Sun, Jan 18, 2009 at 8:14 PM, Martin Dobias  wrote:

> On Sun, Jan 18, 2009 at 6:52 PM, Chris h  wrote:
> > On Sunday 18 January 2009 11:04:13 Florian El Ahdab wrote:
> >> - I believe Qgis doesn't use the S57 sublayers and that's why nothing
> gets
> >> displayed. Is there any chance that I am right? If I am right,
> >
> > Your most likely correct.
>
> Yes, QGIS always opens first sublayers and doesn't care about the rest.
>
>
> >> I would like
> >> to help with the implementation for this kind of problem. Can anyone in
> the
> >> dev team give me directions on where to begin (I have spent some time in
> >> the source and API of both Qgis and GDAL and feel I can contribute
> here...)
> >
> > Perhaps a good start would be reviewing the submitted material above and
> then
> > following the directions and advice of the qgis development team.
>
> First of all, a small change in OGR provider in QGIS will be needed to
> allow sublayers. This provider awaits a file as input string - let's
> add an optional parameter that would specify the layer inside the
> file, e.g.:
> /data/gis/s-57/ca49995b.000&layer=4
> (note the added "&layer=4")
>
> Then in GUI: when an input file for OGR provider is selected, check
> whether there's more than one sublayer - if so, open a dialog and let
> user select which sublayers he would like to see. Create input strings
> for OGR provider from the chosen sublayers and load them.
>
> Patches are always welcome :-)
>
> Martin
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] S57 map files

2009-01-18 Thread Martin Dobias
On Sun, Jan 18, 2009 at 6:52 PM, Chris h  wrote:
> On Sunday 18 January 2009 11:04:13 Florian El Ahdab wrote:
>> - I believe Qgis doesn't use the S57 sublayers and that's why nothing gets
>> displayed. Is there any chance that I am right? If I am right,
>
> Your most likely correct.

Yes, QGIS always opens first sublayers and doesn't care about the rest.


>> I would like
>> to help with the implementation for this kind of problem. Can anyone in the
>> dev team give me directions on where to begin (I have spent some time in
>> the source and API of both Qgis and GDAL and feel I can contribute here...)
>
> Perhaps a good start would be reviewing the submitted material above and then
> following the directions and advice of the qgis development team.

First of all, a small change in OGR provider in QGIS will be needed to
allow sublayers. This provider awaits a file as input string - let's
add an optional parameter that would specify the layer inside the
file, e.g.:
/data/gis/s-57/ca49995b.000&layer=4
(note the added "&layer=4")

Then in GUI: when an input file for OGR provider is selected, check
whether there's more than one sublayer - if so, open a dialog and let
user select which sublayers he would like to see. Create input strings
for OGR provider from the chosen sublayers and load them.

Patches are always welcome :-)

Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] S57 map files

2009-01-18 Thread Chris h
On Sunday 18 January 2009 11:04:13 Florian El Ahdab wrote:

> So here are my questions:
> - has anyone ever worked with S57 and OGR and/or Qgis?

This discussion came up on the gpsdrive list and i've included the pertinent 
parts for you review: 


From Hamish Bowman:

For ENC support in GpsDrive it is still my hope that libS52
could be used to render the data, in a similar way as Mapnik
is rendering OSM data now.

see 
http://apps.sourceforge.net/mediawiki/gpsdrive/index.php?title=Marine_Howto
  (please help improve the wiki page!)

http://grass.osgeo.org/wiki/BSB_data
http://grass.osgeo.org/wiki/S-57_data#libS52
http://openev.cvs.sourceforge.net/openev/contrib/S52/


the very tricky bit is choosing which layers to include. the S-52
gives recommendations of which features to display based on map
scale class, I'd say reuse those. But you would have to enter
that data by hand. If someone provides a list of layernames
per scale band, I might do the rest.

--
response: me, requesting a tutorial to review the material.
---
response: Hamish
---
see SCAMAX and SCAMIN entries in the libS52 CVS file doc/att.txt,

for each token these control which map scales (e.g. 1:25,000-1:100,000)
the feature should be rendered.

and read through the remarks in S52CS.c in the libS52 source
// S52CS.c : Conditional Symbologie procedure 3.2 (CS)

(ignore the code, just look at the comments...)

and the IHO PDF spec docs,
http://grass.osgeo.org/wiki/S-57_data#GRASS_S-52_interface_for_rendering_S-57_data

and you may see why I defer :). It's all there & coded, but a bit daunting
to me.

My idea is a little wrapper C program around S52CS.c to export tokens
based on a list of scales would help us make a table which we could use
in developing the list of layers for the WMS request.

--
since qgis is used extensively in preparing maps for gpsdrive and there is 
significant interest wrt marine navigation where most charts are S-57 vectors 
the long term goal (very long term) is to move toward a plugin for qgis to 
manipulate the data in order to make it available to gpsdrive. However its a 
bit of a challenge as you can see, I'm not a developer, rather just a listee 
with sailboat so I keep interested in this stuff. 


> - I believe Qgis doesn't use the S57 sublayers and that's why nothing gets
> displayed. Is there any chance that I am right? If I am right,

Your most likely correct. 

> I would like 
> to help with the implementation for this kind of problem. Can anyone in the
> dev team give me directions on where to begin (I have spent some time in
> the source and API of both Qgis and GDAL and feel I can contribute here...)

Perhaps a good start would be reviewing the submitted material above and then 
following the directions and advice of the qgis development team. 

Best of luck

/ch

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] S57 map files

2009-01-18 Thread Florian El Ahdab
Hello the lists.

I have been trying to open S57 maps that I use at work in Qgis 1.0.0 without
too much success (I tried a few months ago on a previous version without
success either...).

Actions:
Fresh new Qgis project
Add a vector layer
Select the XXX.000 s57 file and click ok.

Results:
A new layer appears. Nothing gets displayed in the map window. The
attributes table for the layer is empty (there are some columns available,
but no data). No error is displayed on the console.

Research already conducted:
I have been trying to understand what was happening by browsing qgis and
gdal sources, and writing a python plugin to inspect the layer.
I think I can now say:
- OGR loads the map without any error (the s57 driver is correctly loaded,
and generates no error when given my data file)
- Qgis gets the layer from OGR without error. However, this layer as seen
trough the QgsVectorLayer or the QgsMapLayer interfaces (python plugin to do
that) presents 0 features and no subLayers. The extent is 0,0,0,0.

The file itself is good. I can convert it to Mapinfo or GML with ogr2ogr
even if some layers generate errors (s57 features that can't be converted to
other format I believe). All files that I have tried are used every day in
an ECDIS commercial system so I assume the data to be correct.

So here are my questions:
- has anyone ever worked with S57 and OGR and/or Qgis?
- I believe Qgis doesn't use the S57 sublayers and that's why nothing gets
displayed. Is there any chance that I am right? If I am right, I would like
to help with the implementation for this kind of problem. Can anyone in the
dev team give me directions on where to begin (I have spent some time in the
source and API of both Qgis and GDAL and feel I can contribute here...)

Thanks a lot.
Florian
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Re: Problem with Postgis-Manager plugin on OSX

2009-01-18 Thread Martin Dobias
On Sun, Jan 18, 2009 at 2:21 PM, Andreas Neumann  wrote:
> Hi QGIS-Users and Martin,
>
> I am trying to use the Postgis-Manager Plugin on OSX-Leopard.
>
> I installed psycopg2 and use QGIS 1.0 from
> http://download.osgeo.org/qgis/mac/qgis-1.0.0.dmg.gz
>
> When I try to load the plugin, I am getting an error message complaining
> about a UnicodeEncodeError - see text below. Any idea on what I could do to
> fix the problem?

Hi Andreas,

the plugin just wasn't prepared well for use with unicode strings.
I've just released an updated version 0.4.5 which should fix all
possible sources of this kind of errors, so give it a try to see
whether it's fine. Now PostGIS Manager should be able to handle
schemas, tables, column names and other identifiers with non-ascii
characters fine.

Regards
Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Problem with Postgis-Manager plugin on OSX

2009-01-18 Thread Andreas Neumann

Hi QGIS-Users and Martin,

I am trying to use the Postgis-Manager Plugin on OSX-Leopard.

I installed psycopg2 and use QGIS 1.0 from 
http://download.osgeo.org/qgis/mac/qgis-1.0.0.dmg.gz


When I try to load the plugin, I am getting an error message complaining 
about a UnicodeEncodeError - see text below. Any idea on what I could do 
to fix the problem?


Thanks a lot!

Andreas

Error-message:
---
An error has occured while executing Python code:

Traceback (most recent call last):
 File 
"/Users/an/.qgis//python/plugins/postgis_manager/ManagerPlugin.py", line 
39, in run

   self.dlg = ManagerWindow(True)
 File 
"/Users/an/.qgis//python/plugins/postgis_manager/ManagerWindow.py", line 
37, in __init__

   self.setupUi()
 File 
"/Users/an/.qgis//python/plugins/postgis_manager/ManagerWindow.py", line 
648, in setupUi

   self.createMenu()
 File 
"/Users/an/.qgis//python/plugins/postgis_manager/ManagerWindow.py", line 
680, in createMenu

   self.actionsDb = self.listDatabases()
 File 
"/Users/an/.qgis//python/plugins/postgis_manager/ManagerWindow.py", line 
93, in listDatabases

   actionsDb[str(key)] = QAction(key, self)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in 
position 1: ordinal not in range(128)


Python version:
2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)]

Python 
path:['/Applications/qgis1.0.0.app/Contents/MacOS/share/qgis/python', 
'/Users/an/.qgis//python/plugins', 
'/Applications/qgis1.0.0.app/Contents/MacOS/share/qgis/python/plugins', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', 
'/Library/Python/2.5/site-packages', 
'/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC', 
'/Users/an/.qgis/python/plugins/fTools/tools']



--
--
Andreas Neumann
Böschacherstrasse 6
CH-8624 Grüt (Gossau ZH)
Switzerland
Phone: ++41-44-2736668
Email: a.neum...@carto.net

Web: http://www.carto.net/neumann/
SVG Examples: http://www.carto.net/papers/svg/samples/
SVG.Open: http://www.svgopen.org/

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user