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
100% thumbs up 0% 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.
  • 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.
  • Change the header of the combined polygon to reflect the total number of vertices's in both simple polygons, plus the repeated first vertex.
  • 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.
  • 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
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
1    1    Repeat of X1 Y1

 
 
Please see the KB_GridBlank_w_MultiplePolygons.SRF example in the attached ZIP file below to see the result of using the Grid | Blank command with a composite BLN that defines three polygons.

Also see 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
Post Comment for "I want to blank outside several polygons on a map, but the entire map gets blanked, resulting in a horizontal planar grid."
To post a comment for this question, simply complete the form below. Fields marked with an asterisk are required.
   Name:
   Email:
* Comment:
Continue
Powered by ActiveKB Knowledgebase Software

Home * Products * Gallery * Support * About Us * Register * Order * Demos