New answers tagged

0

To import the Shapefile to PostGIS: ogr2ogr -f "PostgreSQL" PG:"host=localhost user=user dbname=db_name password=pw" -nln public.world_borders -nlt MULTIPOLYGON "TM_WORLD_BORDERS-0.3.shp" The Shapefile is imported as MULTIPOLYGON. If you want to expode it to POLYGON in PostGIS, use ST_Dump: SELECT ogc_fid, fips, iso2, iso3, un, name, ...


2

Use GDAL with SQLite SQL dialect http://www.gdal.org/ogr_sql_sqlite.html and utilize LIMIT and OFFSET ogr2ogr -f "ESRI Shapefile" -dialect sqlite -sql "select * from my_shape limit 10000 offset 0" batch_1.shp my_shape.shp ogr2ogr -f "ESRI Shapefile" -dialect sqlite -sql "select * from my_shape limit 10000 offset 10000" batch_2.shp my_shape.shp ogr2ogr -f ...


0

ArMoraer answer is good, but if you prefer a non-destructive solution, you can use a virtual layer. So you don’t delete any feature and you can change threshold at any time. Add a new virtual layer (Layer -> Add Layer -> Add Virtual Layer) with a query like: SELECT * FROM your_layer WHERE area(geometry) > 800 Change "your_layer" with your original ...


1

You can simply use the "Select by expression" tool in the attribute table, with the following formula: $area < 1E6 (you can of course change the threshold). This will select all features whose area is less than 1E6 map units. Then, simply delete the selection with the trash icon (be sure your layer is in edit mode). Note that this will change the file ...


4

As you discovered by trial and error, there were few nagging issues you needed to fix, the last of which was resolved using ogr2ogr's -nlt GEOMETRY* argument. * Note the recommendation in @LeeHachadoorian's comment that -nlt PROMOTE_TO_MULTI be used as a default solution, rather than nlt GEOMETRY, as the former promotes best practice in addition to ...


1

If you want GDAL you can use this (I found this code in another post and it works nice): rs = r'path\to\your\raster' def get_point_values(rs): src_shp = r'path\to\your\shape.shp' src_ds=gdal.Open(rs) gt=src_ds.GetGeoTransform() rb=src_ds.GetRasterBand(1) ds=ogr.Open(src_shp) lyr=ds.GetLayer() for feat in lyr: geom = ...


1

As a free on-line solution for the conversion of CSV with WKB data you can use MyGeodata Converter. Just name your column with WKB data as "wkb" - like this example: id,name,wkb 1,Point 1,010100000000000000000048400000000000003340 2,Point 2,010100000000000000000046400000000000002E40 The WKB data will be automatically recognized based on the occurence of ...


5

You can skip the CSV step and just go straight to shapefile using pgsql2shp, which is installed a part of PostGIS. You could also use ogr2ogr.


3

There is a python module called rasterstats that does compute zonal statistics. For each Polygon, your fields, there will be the underlying rastercells accumulated by SUM, MEAN, MIN or MAX. You find more infos and examples here: https://github.com/perrygeo/python-rasterstats Otherwise you find an example without this module here: ...


3

EDITED 31 May 2016 - Removed need for sum by table by using sum in Spatial Join instead, added step 2. This is an approximate answer, because there is a small possibility of a mistake if two "clusters" of polygons are very close together, it is long, but hopefully quite straight forward. Buffer the polygon layer by a small amount, tick the dissolve box, ...


1

Most simply - because EVERYTHING can read/write a shapefile and by and large they work. Which makes them frustratingly universal when working with multiple software packages (ESRI/QGIS/AutoCad/etc). They're everywhere, and the name has been genericized from a specific file format to a term reflecting ALL spatial data. (I have definitely asked clients ...


0

Have you seen or checked DIVA-GIS that they have China boundary ? http://www.diva-gis.org/gdata Though this site does not have any GIS layers but it has the information about China : http://www.nationsonline.org/oneworld/china.htm They have put up maps that may help you to locate towns,Villages and etc.. GeoNetwork has another one for China as well ...


1

For some reason integer fields aren't always recognized as valid for graduated styling. Putting the integer values into real number fields solves the problem. Now I can copy the layer freely and the real number fields appear as options for graduated on all copies of the layer.


2

I think first of all you'll have to split the csv-files you bought in order to generate 'small' shapefiles of valid size. Then possibly it is a suitable approach for you to load your shapefiles into a PostGIS database and do the merge in the database? Thus you shouldn't have anymore problems with file size an the processing would be faster too.


1

ShapeFiles have size limits: .shp maximum 8gb The other parts, for example .dbf do not, but are recommended to not exceed 2gb. http://www.gdal.org/drv_shapefile.html


0

Try setting the label placement to the "Cartographic" option (available in QGIS >= 2.14). That mode uses the font baseline/ascent for placement.


0

My coworkers and I were all having this problem in versions of QGIS that range from 2.6.1 to the new 2.14. The solution we worked out is to run: Vector > Geometry Tools > Multiparts to Singlepart... The new shapefile produced will now render at all zoom levels. I believe the issue is that the old shapefile had an incorrect ring order (presuming your file ...


2

There is a tool bundled with PostGIS 2.2: PostGIS 2.0 Shapefile and DBF Loader Exporter It allows you to import and export.


3

The "SPIT" plugin is no longer bundled with QGIS, as the plugin was unmaintained and has been surpassed by DB Manager and the processing database import algorithms. changelog.qgis.org/


5

In 2.8 - 2.14 (Not sure about earlier versions) you can export shape files to PostGIS using the build in DB Manager. Open DB Manager In the list of PostGIS databases find the one you want to export to, find the desired schema and pres the button marked with the red outline. Choose the shape file in 'input' (Has to be in your 'Layers Panel') and press ...


7

It looks like it could be from the Project Linework website. Specifically, the "Angular" or "Twenty Seventy" datasets.


0

This might help out. It's a link to what appears to be all state boundaries. https://www.arcgis.com/home/item.html?id=f7f805eb65eb4ab787a0a3e1116ca7e5


2

Figured this out. This process should work for any shapefile held in a Postgis database, and will put it in a format that can then be plotted as a polygon in Tableau directly from the database; no mucking about importing or exporting stuff. It will create a new table containing the data in the shapefile in a format thats usable by Tableau. The more ...


0

I would probably do the following: Vector > Geometry Tools > Polygon Centroids... on your Province shapefile. MMQGIS > Combine > Spatial Join on your Postcode and Province centroid layers and select which fields you want to keep in the output: Note that you may need to download/install the MMQGIS plugin from Plugins > Manage and ...


0

Might I suggest adding an additional process to your model like Delete, so as to remove the shapefile after you have successfully appended it? That way, at any given moment only new shapefiles will be in your workspace when you run the model. Since you are using Pathfinder Office you can at any time recreate the shapefiles if needed


1

This Python script will append shapefiles modified since yesterday to a target fc (I'm not sure if this is what you are after): import arcpy, os, datetime #workspaces workspace = r'D:\Kartdata\tk_riks_Sweref_99_TM_shape\terrang' targetfc = r'D:\Kartdata\test123.shp' #Function that return modification date of files def modification_date(filename): t = ...


0

Make sure you use the right type of single quotes: '' If you use `` the parser will freak out.


0

You're looking for the symmetrical difference tool. In my experience it works very similarly to st_disjoint, only it does it in a "masking" style so the underlying shape can be cut out just so. I struggled with this tool for a while, getting empty outputs, before I discovered a workable solution. Both of my layers were in geographic (EPSG:4326) format ...


4

AutoCAD is a vector drafting software so it doesn't have attributes in the traditional GIS sense like ArcGIS or other GIS's do. Its attributes are meant for the vector (line) parameters such as colour, line thickness, etc. You can add CAD fields to your shapefile and populate those fields with attributes prior to exporting to CAD which will control the ...


0

CartoDB expects shapefiles to be imported in a .zip package that contains, at least: file.shp file.shx file.dbf file.prj Make sure you have included all those files in your .zip package, and that the extension of it is lowercase (.zip and not .ZIP)


2

The document they are referring to, the "extended shapefile format document", comes with the API when you download it. Specifically, when you unzip the download, it is located at \doc\html\extended_shape_buffer_format.pdf.


1

Google is your friend. Looks like Chicago calls those "Community Areas". You can download the shapefile from their Data Portal at https://data.cityofchicago.org/Facilities-Geographic-Boundaries/Boundaries-Community-Areas-current-/cauq-8yn6. Just click on the blue export button in the top-right corner. To get the exact representation as what you linked to, ...


2

You don't need Fiona to write a GeoJSON file features = [feat for feat in fiona.open("a_shapefile.shp") layer = { "type": "FeatureCollection", "features": features} # save json file import json #or GeoJSON with open('result.geojson', 'w') as outfile: json.dump(my_layer,outfile) No CRS is explicitly defined inside the original GeoJSON ...


0

You're close! You might be receiving errors because when you run code from the script, you need to import the relevant modules for the code to run. QGIS loads most of these at startup but the scripts are externally run. Modifying your code slightly, you could use: ##Example=name from qgis.core import QgsVectorLayer, QgsMapLayerRegistry vectorLyr = ...


1

thanks to Devdatta Tengshe EPSG 3857 or 4326 for GoogleMaps, OpenStreetMap and Leaflet i could figure out how to match the two independent shapefiles in QGIS The main problem: The custom shapefile uses in the .prj file the geocoding Google Mercator (EPSG = 900913), while the downloaded postal code shapefile uses EPSG 4326. QGIS does not automatically ...


1

Use the Rasterize (Vector to Raster) tool in QGIS. Go to Raster -> Conversion -> Rasterize. Assuming your vector file and the reference raster (g) are in the same coordinate reference system (CRS), do the following: Browse the input file (shapefile). Define which attribute from shapefile to assign in the raster cells. Choose path and name for the output ...


1

There is now native export into DXF in newer versions of QGIS which allows to export map layers including the labels: More about the functionality can be found here: https://www.qgis.ch/en/projects/dxf-export The DXF export functionality was developed by Jürgen Fischer (Norbit) and Marco Hugentobler (Sourcepole AG). The project was co-financed by SIGE ...


2

There is now native export into DXF in newer versions of QGIS which allows to export map layers including the labels: More about the functionality can be found here: https://www.qgis.ch/en/projects/dxf-export The DXF export functionality was developed by Jürgen Fischer (Norbit) and Marco Hugentobler (Sourcepole AG). The project was co-financed by SIGE ...


0

As Goldring mentionned in his comment you should probably join the 2 tables and compute the percentage, assuming of course that your districts in both years do overlap


1

Save the style Layer (.qml or sld). Export .dgn to shp. Load your shp. Load style(.qml or .sld) for this shape.


0

Try browsing to the location you want to save your shapefile. The "save as" input field should have a path, for example: /Users/yourname/Desktop/example.shp


0

I am not sure If I understood your question here but have you looked at ENVI's tutorials or workflow here ? Here is the link to their tutorial or workflow : http://www.harrisgeospatial.com/docs/tutorials.html You may want to post your question on their ENVI related issues here http://www.harrisgeospatial.com/Support/Forums.aspx You may need to sign up and ...


1

Check Mapzen's metro extracts for Atlanta. They use OSM data and I believe they've also imported Fulton County's data into it. They also have different formats in case you need something other then shapefile


0

Fulton County has GIS data available. If you cannot access the data for download on their GIS website, give their GIS department a call/email and ask if they have an FTP site or other means to download the data.


1

The UK Data Service: Census Support host UK administrative geography shapefiles that can be downloaded directly through their Easy Download service. In an Rmd file to download and load parishes it can be as easy as inserting the following code into an appropriate chunk: if (dir.exists("parishes") == FALSE) { dir.create("parishes") } ...


0

It seems to that your .kml file might just link to a WMS (Web Mapping Service.) To find out, you can open you kml in a text editor, then look for an URL within the document. Look for WMS in the URL. If it's a WMS layer, then you cannot save it as a shapefile. WMS servers take the client request and push composite rasters back. However, if you are lucky, ...


0

It's odd, usually WMS are the kinds of data fetched online. If you can manage to identify where that KMZ is hosted either locally or remotely, it's just a few clicks away in QGIS -> add layer -> load it -> right click -> save as



Top 50 recent answers are included