[Marble-devel] Using marble to render PostGIS data in different Projections

tackat at t-online.de tackat at t-online.de
Mon Feb 10 11:35:38 UTC 2014


Hi, 

Have a look at the email I wrote earlier today - it basically explains in detail why Anders' suggestion is spot on - and how to do it.

Writing this into a QImage is not a big deal - actually there is a ready-made method for that:

marbleWidget->mapScreenShot() which provides the image for you. 

You can even use this without displaying the widget (either by hinding the widget or by using the MarbleMap class instead of MarbleWidget).

Best Regards,
Torsten



-----Original-Nachricht-----
Betreff: Re: [Marble-devel] Using marble to render PostGIS data in different Projections
Datum: Mon, 10 Feb 2014 12:13:32 +0100
Von: Knut Krause <knut.krause at lagom.de>
An: marble-devel at kde.org

Well, since I query the DB like I want to this would be no problem.

I think my bigger question is: Is it possible to render Marble geometries to a 
raster (QImage) with flat projection?

If so I maybe even use the GeoJSON workaround :-)


Knut

Am Montag, 10. Februar 2014, 12:05:40 schrieb Ander Pijoan:
> I don't know if this can be useful, but I coded a geojson parser (
> marble/src/plugins/runner/json/JsonParser.cpp ) that transforms GeoJSON
> geometries to Marble geometries.
> 
> It is thought to receive a geojson file like this one for example (
> http://geojson.org/geojson-spec.html#examples) as it will try to find the
> geometries inside a json array called "features".
> 
> PostGIS has a function ST_AsGeoJSON which returns the geometry in that
> format.
> 
> I don't know if the way you have your system is suitable to create a json
> string with all the geometries you need and send it to the JsonParser or
> something like that.
> 
> 2014-02-10 11:45 GMT+01:00 Knut Krause <knut.krause at lagom.de>:
> > Hi,
> > 
> > I have a PostGIS database with geometries. Now I'd like to do some
> > computation
> > on them. For my core algorithm I need the polygons in raster format. So I
> > would be great if I could somehow use marble to draw my geometries on a
> > flat
> > surface like QImage. To show the result of my algorithm though I'd like to
> > render a path on a plain marble widget.
> > 
> > Is it possible to use marble for that? Right now I use GDAL to transform
> > the
> > geometry from WKB to QPolygonF but that involeves a lot of number
> > crunching
> > myself to get the positions right and I fear I'm not smart enough to cope
> > with
> > projections correctly.
> > 
> > I thought something like
> > 
> > PostGIS -> <magic> -> GeoPainter -> QImage
> > 
> > would be great to render a set of geometries on an image as big as the
> > bounding box of the geometries. Anyone here an idea if this works?
> > 
> > 
> > Knut
> > _______________________________________________
> > Marble-devel mailing list
> > Marble-devel at kde.org
> > https://mail.kde.org/mailman/listinfo/marble-devel

_______________________________________________
Marble-devel mailing list
Marble-devel at kde.org
https://mail.kde.org/mailman/listinfo/marble-devel





More information about the Marble-devel mailing list