MapWindow Developer Team : MapWindow Discussion Forum
A stumbled on the PAL project: [geosysin.iict.ch] after reading this interesting page: h[blog.qgis.org] Quo
Pages: 12Next
Current Page: 1 of 2
[Labeling] PAL project
Posted by: pmeems ()
Date: June 01, 2009 01:18PM

A stumbled on the PAL project: [geosysin.iict.ch] after reading this interesting page: h[blog.qgis.org]

Quote

PAL is a ready-to-use library for cartographic label placement under free software license. Developed at the University of Applied Sciences of Western Switzerland (HES-SO), it is the result of combining experiences of three teams, MIS-TIC in optimization algorithms, IICT-SYSIN in GIS development and G2C in geomatic science and cartography.

Designed for multi-layers and real-time labelling of maps, it provides impressive results, both in terms of execution time and solution quality, using combinational optimization approaches. Options can be set for each layer to customize the labelling process. Options include : priority, in order to decide which of two conflicting labels from different layers to display, the concept of obstacle in order to avoid labels to be displayed above other features, the orientation preference to display labels (free, horizontal, line, centroid, ...).

All functionalities are embedded in a C++ library. A Java library is also available within a JNI wrap to have the advantage of PAL in Java applications. This wrap has been implemented with gvSIG through an extension, extJPAL. It demonstrates that it is possible to integrate the library into any desktop or web application, written in Java or C. In the near future, PAL could be a good alternative to be part of what is known as OSGeo Cartographic Library.

Does anybody have any experience with PAL? We could create a C# wrapper for it and use it for our labeling. That could solve a lot of issues about the labeler ;)

Hope to read your thoughts about this.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn



Edited 1 time(s). Last edit at 06/01/2009 01:21PM by pmeems.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: geofran80 ()
Date: June 01, 2009 01:44PM

Yes Paul, I mentionated in this phorum a few months along and I cannot obtain answer.

I hear about it in one Open Source Conference in Spain by one member of gvSIG.

I think that using this features the label perhaps could be more efficiently in Mapwindow 4.7 and following and MapWindow 6.0

I think that could be useful.

Cheers.
Francisco J.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: geofran80 ()
Date: June 01, 2009 01:47PM

See it:

[geosysin.iict.ch]

Is very interesting.

Cheers.

Francisco J.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: June 02, 2009 12:12AM

Francisco,

Thanks for the link. The PAL library really looks promising.

When it's about C/C++ I always run screaming away ;)
Do you have any experience in writting C# wrappers for C++ libraries?
We might join forces and make this a plug-in and later (for v4.8) a replacement for the current labeler.

I could make the GUI, if you could make the wrapper and the read/write of the label file.

If you're interested mail me at bontepaarden[AT]gmail[D0T]C0M

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: geofran80 ()
Date: June 02, 2009 06:29AM

Friend, how are you?

In answer to your question Do you have any experience in writting C# wrappers for C++ libraries? I haven't idea about it, I only have theoretical idea but not in practice about wrappers. Is not available any wrapper in CSharp for it?

I will try to learn more about it (PAL), and if i see that my help could be useful I will comment you.

If anybody of mapwindow or mapwingis users think that their help could be useful tell us and one more big community could give advance to it.

Let's go to collaborate with this great Project - Mapwindow.

Cheers.

Francisco J.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: June 04, 2009 01:34AM

Francisco,

I've created a enhancement request about this in Mantis: 1317

A Java wrapper is already available so in theory it shouldn't be to hard to create a C# wrapper ;)

If you could start I'll try to jump in later.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: geofran80 ()
Date: June 04, 2009 02:13AM

I will try to see the JAVA Wrapper and try to see if I can convert to CSharp wrapper.

Cheers.

Francisco J.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: geofran80 ()
Date: June 04, 2009 03:37AM

In Visual Studio 2005 there is one conversion tool for Java to Csharp but in my version 2008 I cannot find the tool.

If anybody have the 2005 version installed and can convert the Java Wrapper to CSharp, perhaps we can to modify the wrapper and adapt to VStudio 2008 and .NET 3.5 Framework versions.

Anybody can help us?

Thanks.

Francisco J.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: June 05, 2009 12:11AM

Francisco,

Did you look at these pages:
Sharpen-an open source Java to C# converter
java to c#
Microsoft: Java Language Conversion Assistant 2.0

Most posts/pages I found about converting suggest to do the conversion manually. It's probably faster, with less errors and you can take full advantage of the C# language.

Hope it helps.

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: ejamartins ()
Date: July 04, 2009 08:58PM

Hi Paul and Francisco.
Let'me introduce first to Francisco. My name is Edson and I'm a new developer in this OpenSource project.
I'll try to help you with this new challenge. I'm using the Visual Studio 2008 too.

Thanks
Edson



Edited 1 time(s). Last edit at 07/04/2009 08:59PM by ejamartins.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: Sergei ()
Date: July 27, 2009 01:30PM

Hello, Paul

Have you found any sample code or manual for developer apart form api reference on the site? The project seems very promising but I still don't know how to feed this beast with our shapesfiles.

Regards,
Sergei

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: July 27, 2009 03:22PM

Sergei,

I've been reading the weekly reports by Martin at [www.qgis.org] (the site seems down at the moment, hopefully it will be available again in a few hours/days)
Martin is implementing the PAL library in QGis (Java).
He's done some great work.
I think we should start with his code and convert it to C#. Java and C# are not that different. Or add Martins Java functions to the C++ library.

In a few weeks Google Code of Summer is over and Martin should be ready. No need to reinvent the wheel again.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: Sergei ()
Date: July 27, 2009 05:14PM

Paul,

Ok, I found the code at last.

This is where labeling takes place.
[trac.osgeo.org]

And here are files of pal library. They are modified though.
[trac.osgeo.org]

There are lots of update for now, so better to wait while they finish.

I didn't understand about Java: [trac.osgeo.org]

README for QGIS version 0.9.2 'Ganymede'
----------------------------------------
Quantum GIS (QGIS) is an Open Source Geographic Information System. The
project was born in May of 2002 and was established as a project on
SourceForge in June of the same year. We've worked hard to make GIS
software (which is traditionaly expensive commerical software) a viable
prospect for anyone with basic access to a Personal Computer. QGIS
currently runs on most Unix platforms, Windows, and OS X. QGIS is
developed using the Qt toolkit (http://www.trolltech.com) and C++
. This
means that QGIS feels snappy to use and has a pleasing, easy to use
graphical user interface.

Regards,
Sergei

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: Phil ()
Date: July 27, 2009 08:10PM

Those are all C++ source files.

Converting the syntax of C++ to C# might not be that difficult, but the hard part would be coming up with equivalent classes for all the QGIS and Qt classes used. Look in any of the source files for any type that starts with "Qgs" or "Q" - those are QGIS classes and Qt classes.

Thanks.

-Phil

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: Phil ()
Date: July 27, 2009 08:51PM

What's the license for the PAL library and the QGIS interface code to the PAL library that you're looking at?

QGIS is GPL. Here's a quote from the QGIS user guide:

"QGIS C++ plugins use functionalities of libqgis*.so libraries. As they are licensed under GNU GPL,
QGIS C++ plugins must be licenced under the GPL, too. This means you may use your plugins for
any pur pose and you are not forced to publish them. If you do publish them however, they must be
published under the conditions of the GPL license."

Use of the QGIS GPL code may be incompatible with MapWindow's liberal MPL 1.1 license. Please investigate before proceeding.

Thanks.

-Phil

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: July 28, 2009 02:40PM

Sergei,

I always thought QGis was written in Java. Apparently I was wrong. If the code is in C++ that would make it easier, right?

Thanks Phil for the warning about the licensing.
At the website of PAL is written:
Quote

PAL is a ready-to-use library for cartographic label placement under free software license.
So that would not be a problem.
When QGis is finished with their implementation I'll ask them if we can reuse some of their code. At least we can use it to guide us.

Thanks Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: Sergei ()
Date: July 29, 2009 03:20AM

Hello, Paul.

I agree with Phil that it'll not be very easy to use Qgis code directly, as it uses lots of native classes. Licence issue also makes sense. Certainly it's possibl—É to use it as a guide (just to understand how pal is working).

For now the reasonable thing to do, I think, is to stimulate authors to write an easy API tutorial. Something like these ones:
[gdal.org]
[gdal.org]

From our part It would better to embed these functionality in ocx, I think. Then it'll be availible to all. Remember? I'm using vb6 ;)

Regards,
Sergei.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: Sergei ()
Date: July 29, 2009 04:27AM

Paul,

I've investigated further. PAL uses internally GEOS geometry class: [download.osgeo.org]

If we want to register our shape on pal layer we must implement pal geometry interface for it:
registerFeature (const char *geom_id, PalGeometry *userGeom , double label_x=-1, double label_y=-1)

It has only three members [pal.heig-vd.ch] :

getGeosGeometry () get the GEOSGeometry of the feature This method is called by Pal each time it needs a geom's coordinates
virtual void releaseGeosGeometry (GEOSGeometry *the_geom)=0 Called by Pal when it doesn't need the coordinates anymore.
virtual ~PalGeometry ()

So the first task is to implement getGeosGeometry method. And nobody will do it for us I expect.

I've worked with OGR library yesterday (in seach of geoprocessing functions).

I've written ShapeToOGRGeometry function and a half of OGRGeometryToShape.

Here is methods which this functions will give us: [gdal.org]
It's easy to convert OGRGeometry to GEOS geometry (an efficient procedure exists). Thus it seems that my yesterday's work will be useful for pal too.

For perfomance reasons maybe it will be better to have direct functions GeosGeometry2Shape and Shape2GeosGeometry. It'll be easier to write them after as GEOS and OGR class models for geomerty representations are similar, but OGR is better documented.

Regards,
Sergei



Edited 1 time(s). Last edit at 07/29/2009 04:38AM by Sergei.

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: July 30, 2009 04:37AM

I've talked with Martin, he's doing the PAL implementation in QGis and he told me he's written everything in C++ and with a minimum of QGis functionality. That's good news, I think.
As Sergei already found out the GEOS library is used, but MapWindow is already using that.

I also contacted the original guys of PAL. Martin and I want to suggest to make PAL a shared project within OSGEO. So everybody can use it and modify it.
The original version would be v1.0 and Martins/QGis version would be v1.1
I also suggested to use the same license as GDAL, that would not give problems with us.
I have no reply yet from Switzerland.

I'll keep you posted.

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: [Labeling] PAL project
Posted by: pmeems ()
Date: August 14, 2009 12:24AM

Here's an update.


I've had some contact with Olivier Ertz, one of the authors of the PAL library and he tells me he sees no problems with the license:
Quote

PAL is LGPL v3, so it can be linked to MapWindow

He already is in contact with OSGeo and he hopes to have the PAL library available around October. That version will be on a central location and the changes Martin (QGis) has made will be merged.

Our challenge will be to create a C#-wrapper, like the JNI wrapper for gvSIG.

I also talked with the MapWindow v6 team (Ted Dunsford) and they are also very interested in using the PAL library for their labeling. So hopefully we can make the labeling using PAL once and use it for v4 AND v6.

If anyone wants to join this sub-team to create the C# wrapper and use it in MapWindow, please let me know.

Thanks,
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: