logo

img

Knowledgebase Home | Contact Knowledgebase Home | Contact
Search the Knowledgebase Browse by Category
I want to blank outside several polygons on a map, but the entire map gets blanked, resulting in a horizontal planar grid.
User Opinions
60% thumbs up 40% thumbs down

How would you rate this answer?
Helpful
Not helpful
Q: I want to blank the grid nodes outside several polygons on a map, but the entire map gets blanked, resulting in a horizontal planar grid.

A: It may be that the area outside polygon A is inside polygon B, and vice versa, causing the entire map to be blanked. To use this file, you can combine the polygons from individual polygons into a single complex polygon.
  1. Combine the two polygons into a single polygon, and repeat the first vertex of the first polygon at the end of the second polygon to create a single combined polygon.
  2. Change the header of the combined polygon to reflect the total number of vertices in both simple polygons, plus the repeated first vertex.
  3. If you load the combined polygon as a base map, a line is drawn back to the first vertex, so you may need to keep both versions of the BLN available, the separate polygons to use as a base map, and the combined polygon to use for blanking purposes.
  4. It is important to repeat the original x1 y1 value after every polygon in order to avoid residual artifacts from the blanking process. 
Two separate polygons

5 0 'Polygon A (has 5 values)
1.0 1.0
1.0 2.0
2.0 2.0
2.0 1.0
1.0 1.0
5 0 'Polygon B (has 5 values)
3.0 3.0
3.0 4.0
4.0 4.0
4.0 3.0
3.0 3.0

 One combined polygon

11 0 'Polygon A (has 11 total values)
1.0 1.0 'x1 y1
1.0 2.0
2.0 2.0
2.0 1.0
1.0 1.0
3.0 3.0 'Polygon B
3.0 4.0
4.0 4.0
4.0 3.0
3.0 3.0
1.0 1.0 'repeat x1 y1

 
Blanking the area outside
multiple separate polygons blanks
the entire grid

 
Editing the blanking file
to combine the polygons
resolves the problem.



In a more complex example, consider adding a third polygon.

One composite BLN file with three polygons:

17    0    Composite Polygon consisting of Polygon A, B, and C
1    1    Polygon A - Original X1 Y1
1    2    Polygon A
2    2    Polygon A
2    1    Polygon A
1    1    Repeat of X1 Y1 and closure of Polygon A
3    3    Polygon B
3    4    Polygon B
4    4    Polygon B
4    3    Polygon B
3    3    Polygon B
closure of Polygon B
1    1    Repeat of X1 Y1
7    5    Polygon C
7    6    Polygon C
8    6    Polygon C
8    5    Polygon C
7    5    Polygon C
closure of Polygon C
1    1    Repeat of X1 Y1
 
 
Please see
KB483_GridBlankMultPolys_Example.zip attached below to see the result of using the Grid | Blank command with a composite BLN that defines three polygons.

Also see the attached script which automatically converts a BLN file with multiple polygons into a BLN file with a single complex polygon. Download the script and open it in the Scripter program that comes with Surfer. Go to Script | Run and follow the prompts.






Visitor Comments
No visitor comments posted. Post a comment
Related Questions
Attachments
Products