[Qgis-user] Creating Geometries for tabular data

Nyall Dawson nyall.dawson at gmail.com
Mon Nov 23 12:31:33 PST 2015


On 17 November 2015 at 06:59, Matthias Kuhn <matthias at opengis.ch> wrote:
> I use the process on a postgis DB, but Shapefiles are also capable of having
> tabular data without geometries attached.
> However I do not know how you would create such a file (easily) from an
> existing geometry-less layer.
>
> Maybe something like this:
> http://gis.stackexchange.com/questions/327/how-can-i-convert-an-excel-file-with-x-y-columns-to-a-shapefile
>
> Or try with adding a dummy geometry column in a csv so it loads as points
> and then save as shapefile.

Ok, with improvements that just landed in QGIS master (see [1]) this
is now MUCH easier. Now, you can right click the geometryless table in
the legend and select "Save as". In the save vector layer dialog
there's a new option to override the geometry type for the saved file.
So you can choose to save the geometryless table with a
Point/Line/Polygon geometry, which will obviously all initially be
empty. Then, you can select features from the attribute table and use
the "add part" tool to attach geometries to these records.

The new option also lets you force the saved file to be multipart,
which is also useful in some circumstances.

Nyall

[1] https://github.com/qgis/QGIS/commit/ffebfd9bb719daf1ffa9bf7dde68c6e5892dcb89

>
> Best,
> Matthias
>
>
> On 11/16/2015 03:00 PM, DelazJ wrote:
>
> Hi,
> Matthias, what kind of format can this file be?
> This is not the first time I see MapInfo user asking about this feature. I
> personnaly had last week to add geometries to features that were in a
> tabular file (csv) and couldn't find how to do this except giving an unique
> ID to the table data, and in another shapefile digitizing, filling ID after
> each drawing and, at the end joining layers. It was possible because there
> was not so many features but it's unfriendly.
> I thought I could save the csv into shapefile (even empty)  and proceed with
> the "add part" tool but "saving as" failed.
> It would be nice if we could find a way to address this "issue"...
>
> 2015-11-16 7:22 GMT+01:00 Matthias Kuhn <matthias at opengis.ch>:
>>
>> Hi,
>>
>> IIRC you can use the "add part" tool to create geometries for existing
>> objects. Just use the attribute table to select the proper object and
>> then digitize with the add part tool. Of course the selected layer has
>> to be capable of saving geomtries in the format you like (i.e. you
>> cannot geometrizise an excel table).
>>
>> Cheers,
>> Matthias
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



More information about the Qgis-user mailing list