Hot answers tagged grids
14
I see MerseyViking has recommended a quadtree. I was going to suggest the same thing and in order to explain it, here's the code and an example. The code is written in R but ought to port easily to, say, Python.
The idea is remarkably simple: split the points approximately in half in the x-direction, then recursively split the two halves along the ...
7
It looks like you're using a geographic coordinate system instead of a projected coordinate system. Because NAD83 (HARN) uses degrees as the units, when you type in 500 in the grid spacing, it's using a spacing of 500 degrees, which is huge. You'll need to reproject the data to a more suitable projected coordinate system which uses metres such as UTM Zone ...
7
Using ArcGIS, one way to go about this is to create a 1 X 1 KM Fishnet grid followed by using the Split tool.
The general workflow/model looks like this:
6
The data as downloaded contain some frank locational errors, so the first thing to do is limit the coordinates to reasonable values:
data.df <- read.csv("f:/temp/All_Africa_1997-2011.csv", header=TRUE, sep=",",row.names=NULL)
data.df <- subset(data.df, subset=(LONGITUDE >= -180 & LATITUDE >= -90))
Computing grid cell coordinates and ...
5
The PRISM Climate Group's precipitation raster below is at an 800 m scale. They also have 2 km and 4 km climate products. Climate source uses both 400 m and 2 km grids for their precipitation products. A description of the PRISM methods can be found here. A study area, for example, in the Rocky Mountains would benefit from a greater resolution, while a ...
5
I have written an R function that performs a robust regression (least absolute deviation method) against a DEM to up-sample climate variables. It works quite well for smaller areas where the gradient in the [X,Y] domain does not effect the estimates and is quite superior to resampling and interpolation techniques. It is a loose implementation of Nick ...
5
See if this algorithm gives enough anonymity for your data sample:
start with a regular grid
if polygon has less than threshold, merge with neighbor alternating (E, S, W, N) spiraling clockwise.
if polygon has less than threshold, go to 2, else go to next polygon
For example, if the minimum threshold is 3:
4
For raster formats, I think the Esri ASCII Grid format is most the commonly supported format across GIS software. Since it is ASCII, it is portable to read anywhere, even in a text editor. Many closed and open-source software (particularly recently developed) generally use GDAL, which has a native AAIGrid driver.
The two drawbacks are the file size (but it ...
4
The 'National Grid Shape file' can be downloaded at:
http://www.ordnancesurvey.co.uk/oswebsite/pai/maps.html
Using this for a OS grid at a specific resolution would take some aggregation based on the TILE field, or by using the SCALE field.
4
You're right ... it is pretty easy! The "raster" package has some pretty straightforward ways of dealing with creating and manipulating rasters.
library(maptools)
library(raster)
# Load your point shapefile (with IP values in an IP field):
pts <- readShapePoints("pts.shp")
# Create a raster, give it the same extent as the points
# and define rows and ...
4
I just ended up creating my own tools to do this.
I used the Clipper library (http://www.angusj.com/delphi/clipper.php) along with OGR to divide my data set up. Something to note is performing intersections naively with this lib takes very long, so I instead used a quadtree approach... ie, divide into four grid cells, divide each of those into four more, ...
4
It definitely sounds like you have geometry issues. It is unlikely that will be able yield clean results from a dirty input file regardless of the software used, unless you first address your geometry problems. Once you get your geometry issues sorted out, you could try the following if you are still having issues:
1) Make sure that your grid dataset has ...
4
This question comes up often. Every GIS seems to have an add-on to solve it, but they tend to be limited in what they can do. (E.g., many will only create square grids of points parallel to the coordinate axes.) I would like, therefore, to describe a simple general way to create regular grids of 2D points, suitable for use in any GIS.
Surprisingly, most ...
4
There is possibility to do it in Print Composer now. Also it is possible to simply manually create vector layer with grid in QGIS (Vector->Research Tools->Vector Grid) - the only way if more grids are needed in one frame.
In Composer Manager select map frame and go to Item Properties / Grid
4
Similarly to Paulo's interesting solution, how about using a quad tree subdivision algorithm?
Set the depth you would like the quadtree to go to. You could also have a minimum or maximum number of points per cell so some nodes would be deeper/smaller than others.
Subdivide your world, discarding empty nodes. Rinse and repeat until the criteria are met.
3
Try using degrib, which is a product of National Weather Service's Meteorological Development Lab (NWS MDL).
It can convert GRIB1 and GRIB2 to several different formats. It won't be able to convert GRIB1 directly to GRIB2, but you should be able to convert GRIB1 to CSV or another format. The tutorial page is the best source for usage information (follow ...
3
I don't think a new release or service pack will resolve the issue, though you could always add it to ideas.arcgis.com and see what happens. Perhaps an alternative approach might work for you though: Add two grids, one with north-south only lines/labels and the other with east-west only and make each in a different style/font/colour.
This will address the ...
3
OK, take 2...
If you're looking for a region of specific size and area:
As before, classify your cells by the slope.
Then do a Region Group on the raster. The count value will give you area values for the raster.
Then if you need regions of a certain width (ie, not something long and thin) run Zonal Geometry with the Thickness option, which will give you ...
3
Your best bet would be to first calculate slope, as om_henners has mentioned, then use a focal operator to collapse the result down to the scale you're interested in. I'd recommend using FocalMean, where the neighborhood size matches the scale of 'flat' areas you're interested in. So for example, if you had a raster of 10m resolution, a 5x5 neighborhood ...
3
It won't look terribly realistic without taking into account roads. I suggest you'll need to work out a few classes of population density / urbanization, and build separate models for how you'd populate each one. A very simplistic low-population suburban model may look like:
Split road lines into the segments that exist between intersection nodes
...
3
GIS file formats contain georeferencing information. This ties image pixel coordinates to grid references in a projection system, in this case British National Grid.
There are lots of ways this information can be stored depending on image format. A basic tool to get you started is gdalinfo which will query the extents of the image in British National ...
3
What you want is a spatial join. It allows you to combine information from different tables by using spatial relationships as the join key, in this case, the river basin and gridded points. What it will do is transfer attributes from your river sub-basin to your points. That way, your points would now have a sub-basin attribute. You'd know which sub-basin it ...
3
if I remember correctly, you can use Feature To Point (Data Management) for getting centroids of your polygons.
import arcpy
arcpy.FeatureToPoint_management(inFeat, outFeat, "CENTROID")
i hope it helps you....
3
Well, what you want is a basic so called "Spatial Join", which matches two shapefiles to each other and allocates the sum (count number) to the resulting attribute-table. If you search for "Spatial Join in R" you'll find numerous examples even here on GIS.Stackexchange.
I quickly googled and found for example this code posted on a mailing list.
If you want ...
3
In answer to my own question, I've written a program to "vectorize" an ArcInfo Grid ASCII files as an ESRI shapefile with a single layer containing oriented polygonal grid squares centered at the points of the grid, with an attribute value equal to the value at the coordinates of the centroid. The program (still under development) is available on GitHub. An ...
2
For the first type, coordinate grid would be a good choice.
For the second type I would choose either:
graticule
stadia lines
hair lines
calibration lines
Although these words don't come from the cartographic world per se, you don't tend to find them on paper maps; so there's been no need for a cartographic name for them. You might find a graticule ...
2
Do you mean something like this:
Open the MapBasic Window and paste the following:
SELECT * FROM [GRID_TABLE_NAME] , [Symbol_TABLE_NAME] WHERE [GRID_TABLE_NAME].OBJ INTERSECTS [Symbol_TABLE_NAME].obj INTO ObjsIntersect
BROWSE * FROM ObjsIntersect
I'm, doing this from memory, so the syntax may be:
SELECT * FROM [GRID_TABLE_NAME] , [Symbol_TABLE_NAME] ...
2
This problem has many different solutions: it needs further restrictions. After all, by choosing any value within the range of elevations in the dataset, the contour for that value will be "flat" (and horizontal). This probably is not the sought-for answer, but it is an answer and it's perfectly valid. Moreover, among all possible answers, the contour ...
2
Voronoi polygons might work but you definitely don't want Delaunay triangulation for this task. However, if you know the grid to be regular, you can just use the Create Fishnet tool from the Data Management Tool box (under Feature Class tools). The Fishnet tool has a lot of options that with a little understanding of your point dataset, will enable you to ...
Only top voted, non community-wiki answers of a minimum length are eligible


