two problems with lines and polygons.

I work with maps in a regular basis and I have two problems. Dealing with maps always needs some tools to prepare the base of the projection, contour lines, state borders, and then to convert to the appropiate design tool. These are the two problems:
1) When I convert to SVG the map looks ready to work, but all the lines are discontinuos even that they look continuos in appearence. In other words, they are segment of lines overlapping to each other. Therefore when I select a contour line or a state border, I can not work with it unless I join all the line segments. I tried all the possible options to join to separate lines into one, but I didn't succeded. It seems that the node tool is only for the same object. Can you give me a hint how to tackle this problem?. I also want to fix the problem since the begining, I want to write a small program to fix the SVG file and convert it directly to single lines. I need your advice to do it.
2) Many times I have a closed polygon, therefore I can fill with color, put patterns, etc. (for examlpe a State line). And sometimes I have an open line that is not closed but the two end-nodes touch closed polygons (in this case the border state). I want to convert the open line to a closed polygon using boolean operators. The problem is that I have to preserve both polygons. At the end I need two closed polygons. ( I guess my boolean arithmetic is not good enough). I need some hints.
Thank you...
Roberto

Quoth Roberto Ortega on or about 2004-07-16:
I work with maps in a regular basis and I have two problems. Dealing with maps always needs some tools to prepare the base of the projection, contour lines, state borders, and then to convert to the appropiate design tool. These are the two problems:
- When I convert to SVG the map looks ready to work, but all the lines
are discontinuos even that they look continuos in appearence. In other words, they are segment of lines overlapping to each other. Therefore when I select a contour line or a state border, I can not work with it unless I join all the line segments. I tried all the possible options to join to separate lines into one, but I didn't succeded. It seems that the node tool is only for the same object. Can you give me a hint how to tackle
Sounds like you want to first use the Combine operator (Path>Combine or Ctrl+k) on several selected objects using the select tool (F1). Then, using the node editing tool (F2), select a pair of endpoints that you want to join and use the third and fourth buttons from the Tool Controls bar (they have a green downward arrow).
this problem?. I also want to fix the problem since the begining, I want to write a small program to fix the SVG file and convert it directly to single lines. I need your advice to do it.
Ouch. That is difficult, but here are some ideas:
* Work out what all the paths you want to join have in common (e.g. they all have a "stroke:#00FFFF" string in the style attribute). * Sort the objects so all the <path>s to combine are in one spot. * If the endpoints of two separate parts of the path are at the same co-ordinate, you may be able to join them. Paths `d' element get pretty complicated, so you may prefer to use something like librsvg to do some of the parsing.
If you send a small sample (or a url to it) I could probably be more specific.
- Many times I have a closed polygon, therefore I can fill with color,
put patterns, etc. (for examlpe a State line). And sometimes I have an open line that is not closed but the two end-nodes touch closed polygons (in this case the border state). I want to convert the open line to a closed polygon using boolean operators. The problem is that I have to preserve both polygons. At the end I need two closed polygons. ( I guess my boolean arithmetic is not good enough). I need some hints.
Let me give an example and see if I understand correctly.
There is a square (the polygon) with co-ordinates ((0,0),(0,2),(2,2),(2,0)). Call this A.
There is a `triangle' represented by the path ((0,2),(1,4),(2,2)). Call this B.
You want to end up with a square A and a triangle B, both closed paths (polygons).
I think this will work:
1. Duplicate A. Call the duplicate A2. 2. Union A2 and B. You now have a square A and a closed (irregular) pentagon B. 3. Duplicate A. Call this duplicate A3. 4. Bring B to the front (i.e. above A3). 5. Difference A3 and B. You now have a square A and a closed triangle B.
This is just off the top of my head, I haven't checked it.
-trent
participants (2)
-
Roberto Ortega
-
Trent Buck