Tag Info

New answers tagged

0

Another possibility is to use the QGIS SimpleSvg plug-in to convert the shapefile to SVG and then use the open source InkScape vector editor or Adobe Illustrator to manipulate the polygons which is trivial. The plugin will embed the attributes in the SVG XML. I am confused about exactly how you're dealing with the shapefile in Java. Swing is just a ...


2

You can move your features using the Move Feature(s) tool on the Digitizing toolbar. Scaling is a little trickier, but can be done through the Affine tool in the Affine Transformations plug-in. See here for more on how to resize features in QGIS.


3

As stated in GIS-Jonathan's answer this can be accomplished by setting the file permissions to Read-only. In windows 7 you can accomplish this by navigating to the file in windows explorer, right clicking the file with the .shp extension and clicking 'properties'. There should be two checkboxes near the bottom of the properties window that say 'Read-only' ...


4

You don't want to do that. What you want to do is add a second and third data frames on your map (on layout), one for Alaska, and one for Hawaii.


0

Strictly speaking this isn't really a GIS question because this is done outside of the GIS using the Operating System. For that, try something like this: http://www.geekpolice.net/t4010-how-to-set-or-unset-the-read-only-folder-attribute-in-windows-7


1

JOSM has the feature to define custom map styles: http://josm.openstreetmap.de/wiki/Styles


3

To find out the right CRS, create a new project in QGIS with project CRS set to EPSG:3857, load Google or OpenStreetMap background from the Openlayers plugin, and look where your data is placed. If you set the Layer CRS of your data to EPSG:32749 WGS 84 / UTM zone 49S, your data will be placed in the right position (at least the same place a Google search ...


2

Those input points are not in urn:ogc:def:crs:OGC:1.3:CRS84, since that is (roughly) WGS84 lon / lat, and (taking the first point): [ 383707.21875, 9211513.0 ] is not a reasonable lon / lat combination. What QGIS is (probably) doing in converting that point to -52.78125,9211513.0 is taking 383707 and wrapping it around a few times (383707.2185 - 1066 * 360 ...


0

It depends what tool your Copy Raster tool is feeding into. If you look at the Syntax section of the help for the tool. The output is a Raster Dataset. Many tools take Layers as inputs so without actually seeing your model I suggest you pass the output of the Copy Raster tool into a Make RasterLayer tool then feed that into the downstream tool?


2

If qgis freezes, try the same command in GDAL/OGR: Open source software to merge large shape files It gives you the opportunity to see error messages, as well as saving valuable RAM that is used by the QGIS GUI. The shapefile 2GB limit that you cross can not be solved by that, so you need another output format, like spatialite database.


2

According to this ticket: http://josm.openstreetmap.de/ticket/10214 you need to have a .cpg file along with the shapefile with the correct encoding written inside. And a josm version that is less than 6 months old (when the bug was fixed).


2

Working (albeit cumbersome) solution to convert KML-/KMZ-files with <gx:Track>-Extension to gpx/csv/tcx, via Googles MyTracks-App. I tried to import a .kmz-file to QGIS, containing a GPS-track as <gx:track>-Element. (Track was recorded with MyTracks-App on Android. I only had the .kmz.) After numerous attempts, using various tools ...


2

I disagree that QGIS always uses multipoint. If you use the Extract Nodes tool, you get a single point layer, and converting Multipart to singlepart and back changes the geometry type as expected. You can run ogrinfo on the shapefiles to check the geometry type. Unfortunately, QGIS reports the layers metadata always as Point.


1

Use intersect tool with single input, call result OVERLAPS. Select original that intersect OVERLAPS and dissolve originals. Switch selection in originals and merge with dissolved.


2

If you mean to keep the attributes meaningful, it makes no sense to dissolve the overlapping polygons if you care about those attributes. Since it appears that dissolve has already occurred, then if your problem is sliver polygons, you should perform an Intersect on the one feature class and then select every polygon in the original that overlaps a small ...


2

If you don't mind a few extra geoprocessing steps, I would suggest a workaround. Before dissolving, perform the following steps. Select all features in your shapefile. This is easy to do with the 'switch selection' button in the shapefile's attribute table. Then perform a select by location, with the shapefile as both the input and the selection feature. For ...


4

The following script determines the bounding box of a raster and creates based on the bounding box a geometry. import ogr, gdal raster = gdal.Open('sample.tif') vector = ogr.Open('sample.shp') # Get raster geometry transform = raster.GetGeoTransform() pixelWidth = transform[1] pixelHeight = transform[5] cols = raster.RasterXSize rows = raster.RasterYSize ...


2

This wont really be an answer, but its the only way I can add a picture. I have data from TeleAtlas/Esi. I cant talk to its accuracy, but I believe its data 2009 (and not sure how it was created). Downloading and overlaying the StatsCan data (which they say is used from CP with permission) you can see the obvious differences. TeleAtlas/Esri show T5E/T0A in ...


4

The forward sortation area (FSA) is only the first 3 characters in the six character Canadian postal code. You need to include the local delivery unit if you want unique values. From here:


1

I suggest to use this program to rename your files http://www.bulkrenameutility.co.uk/Main_Intro.php. It's open and easy to use. After you have renamed your file, you must open, with a text editor, your qgis project file (try notepad++) and make the same find&replace.


1

If you have a consistent schema for renaming them, you could do this in a python script. One method in python is os.rename(src, dest). Specific details would depend on what the algorithm for renaming the files is. This is for renaming the actual files, not just the layer names in the TOC. Otherwise, I don't know of an alternative to renaming them manually, ...


1

I have run into the same problem using QGIS today. Whilst I appreciate that it's late to answer I thought this might help. My KML (WGS84) layers, which were exported from an OSGB (ESPG:27700) Shapefile were all offset to WSW by 3 - 5 Metres. I managed to work around this by exporting to GeoJSON (WGS84) and then exporting the GeoJSON layer to KML format. ...


2

There is a native (non-plugin) solution within QGIS: Right-click on your shapefile layer and select "Save as". Select CSV format; Deselect "Add saved file to map"; Under "layer options", select GEOMETRY AS_XY (for point files) or GEOMETRY AS_WKT (for points, polygons or lines). For point files only, this will output a CSV file with an X and Y column in ...


0

I found some code here Is there a python option to "join attributes by location"? that uses Shapely and Fiona that outputted the points and then rearranged the code to output the polygon instead. This seems to be working on one of the 5 grid point buffer geographies and running through the ~80,000 grid points. import fiona from shapely.geometry ...


3

You can use the Geometry Export to CSV function on your shapefile to obtain coordinates via: MMQGIS > Import/Export > Geometry Export to CSV Make sure it is enabled in Plugins > Manage and Install Plugins...


4

Excellent answers provided by @ChrisW and @CAccesible, both describe techniques which should do what you want. Just to add on what @ChrisW mentioned, a spatial join tool called Join by location would provide your points layer with another attribute column containing the names of the polygon it resides in, regardless of how many points there are in a polygon. ...


1

Is there more than one point in any given polygon? That relationship will affect available methods. A simple Intersect will get the polygon names on the points, regardless of the number of points in a polygon. To get the point attributes on the polygons will likely require a Spatial Join. If there is more than one point in a polygon, you have to decide ...


1

SAGA GEOALGORITHMS>SHAPES-POINTS> Add polygon attributes to point With this tool you must select the points.shp, the polygon.shp and the attribute (column) that you want to extract to the points.shp. Hope this may help you.


0

Google's table fusion might be a good place to start. https://support.google.com/fusiontables/answer/2571232?hl=en


2

This seems to work for me - I'm using the Admin Boundaries from Natural Earth and a Blue Marble jpeg (with a hand cranked world file) and this code which gives me this image. Without seeing your actual datafiles my suspicion is that you have a tiff file with either no world file or a broken one instead of a geotiff. If that is the case then you should be ...


0

As I have said in my comment, you will not get the layers with 2011 census information. However village layer with 2001 census information are available from Survey of India at a fixed price. I have also found some data at this link: https://archive.org/details/IndiaVillageBoundaries I cannot vouch for its heritage, completeness or accuracy, but what ...


1

1) Since version 1.10, you can use ogr2ogr (GDAL) to agjust/"georeference" a shapefile with control points or GCPs (as Spatial adjustment in ArcGIS, look at How to georeference a vector layer with control points? or Add ability to transform vectors based on GCPs in ogr2ogr) Example ogr2ogr -gcp 5 -135 0 0 \ -gcp 283 -135 1000 0 \ -gcp 5 278 0 ...


0

You need to select the polygons sharing a particular species before running polygon to raster, and have to repeat the operation for each species. Geoprocessing tools should honor selections for inputs, so the resulting raster will only be for one species. Depending on how many you have and how often this might be repeated, you might want to consider building ...


1

Your 'ENGL_NAME' shouldn't be abbreviated at all (less than 10 characters), but writeOGR has its own will, it seems. Instead of writeOGR(shp, "PolygonsV2", speciesname, driver="ESRI Shapefile") you might try currdir <- getwd() #store your current working directory setwd(paste(currdir,"PolygonsV2",sep="/")) #switch to your desired folder ...


4

Use spTransform to transform the coordinates to WGS84: library("rgdal") library("rgeos") map <- readOGR(".", "kommuner1983") map_wgs84 <- spTransform(map, CRS("+proj=longlat +datum=WGS84")) plot(map_wgs84, axes=TRUE) gCentroid(map_wgs84) # SpatialPoints: # x y # 1 10.05 55.96 # Coordinate Reference System (CRS) arguments: +proj=longlat ...


0

Bob Heitzman's XLS for GTFS spreadsheet tools can import and export KML, as well as its main function to import and export GTFS feed.


2

I think this question is most easily answered by taking your shapefiles and doing two tests: Append them together and examine the result Union them together and examine the result If either or both tests cause an error or do not meet your requirements then, after reviewing their documentation, you will be in a position to ask a more focussed question. ...


3

Printing out the raw bytes isn't the problem. The issue is knowing where to look in the byte stream for the data you want. The dBase-III+ format used in shapefiles is documented in many places. It starts with a 32-byte header, then has one 32-byte field descriptor for each field, then a 1-byte terminator, then has N bytes for each record, the first of ...


3

Perhaps DIVA-GIS may contain the shapefiles you're after with some corresponding boundaries. Select India as your country and your subject, I chose Administrative areas and received 4 shapefiles of differing levels. Choose the "IND_adm3" layer to see all the Mumbai areas within the Maharashtra district. Note: The shapefiles are outdated as Mumbai is still ...


0

You can do Spatial Adjustment (Edge Snap/Edge match) to link your points and polyline. I have been doing this as well as I'm working with water utilities. Just make sure you are creating a link for the right point to the right node in the polyline. A few links will do.


0

You could pick any attribute and symbolize it using a Graduated symbol with a four color ramp, or however many colors you want. If you want more control over which colors get used, I would recommend adding a mapcolor integer field with as many values as colors you want to use. For example, the Natural Earth country data includes mapcolor7, mapcolor8, ...


0

I was having a similar issue and I used the -W "latin1" option and when using and it took care of my issues: shp2pgsql -I -W "latin1" -s 3857 mgau2013v6_0/agebs_urbanos_2013.shp public.mexico_shape_data | psql -d osm I found that this was a helpful reference for the syntax: http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg


1

In geology, a common way to represent boreholes could be: borehole x y top thickness pH-Value 1 .. .. 0 20 4 1 .. .. 20 20 5 1 .. .. 40 20 7 2 ... ... 0 30 3 ..... This allows to represent vertical boreholes in 3D (with GRASS GIS here)


2

Actually, in order to be most useful you probably want to keep the tabular data as you have it with a separate record (or attribute) for each depth. Combining the data from each depth into a single field will limit the use or make it much more difficult. With it separate you can look at each depth as a different surface in interpolation or perform any other ...


5

You can do this using 2 os.path functions (splitext and basename): import os os.path.splitext(os.path.basename(r'C:\user\shapefiles\polygon.shp'))[0] # returns 'polygon'


0

To solve this issue you must add -lco ENGINE=MyISAM to your ogr2ogr command. -lco NAME=VALUE: Layer creation option (format specific) GDAL ogr2ogr docs In this case this parameter sets storage engine for MySQL table(s). In MySQL 5.6 spatial indexes supports only on this storage engine. For indexing spatial columns, MyISAM supports both SPATIAL ...


1

Yes this is a standard GIS shapefile. A shapefile is a bit of a misnomer as it contains between 3 and up to 10 parts. You have all the correct parts. You can install QGIS on ubuntu easy enough https://www.qgis.org/en/site/forusers/alldownloads.html It works on linux or windows, once installed you need to add a vector layer.. Use the this to add your data ...


0

As PolyGeo commented, a list and a for loop will prove quite helpful. In the code below, InLayer1 through InLayer4 are the paths to the shapefiles. I then make a list out of these variables. The proceeding for loop iterates through each input layer and applies the same code to each. Note that this code applies the same symbology to each input layer. If each ...


2

Looks like you may not have GDAL installed, ogr2poly.py will not work without it. Download either the 32-bit or 64-bit GDAL installers, depending on your system. You need to install the GDAL core, and then the GDAL Python bindings.


0

Thanks for the idea, I tried it, but with limited speed up. Isn't there a way for a direct memory access? I load the same data with python in Paraview which takes 10sec for 600 000 triangles. QGIS takes >1h ... And, not only changing attributes, but also shift painting triangles or shifting geometry.



Top 50 recent answers are included