Can I use a path to select all objects laying within in it?

Post questions on how to use or achieve an effect in Inkscape.
a3an0
Posts: 2
Joined: Mon Nov 28, 2016 8:14 am

Can I use a path to select all objects laying within in it?

Postby a3an0 » Mon Nov 28, 2016 8:40 am

Hi y'all,

I'm working on a high-res world map that eventually will look like the mock-up image attached, thereby using a multi-layered map that I bought. As you can see I'm working with a double colour palette for the time zones: blue colours for the water, and grey colours for the land.

AOI-map-2x5paletteAOI-MidnightBlueBrighten-MidnightBlue2BlackGreyBrighten-lowres.png
AOI-map-2x5paletteAOI-MidnightBlueBrighten-MidnightBlue2BlackGreyBrighten-lowres.png (175.05 KiB) Viewed 1603 times


The problem is in creating the grey areas on the land using the over-all time-zone areas. Unfortunately, the base map does not differentiate for the various time zones for the land areas: all land is the same colour.

The black/grey image shows how I have made a layer with the TZ zones in grey. The TZ layer is complete/continuous and laying underneath the land layer.

map-grey-screenshot.png
map-grey-screenshot.png (245.7 KiB) Viewed 1603 times


So now I have to somehow combine the grey-coloured TZ zones with the black-coloured land. And that is where I'm stuck now.

The layer with the TZ zones consists of (one group of) 50 objects (paths), and the layer with the land consists of (one group of) more than 25.000 objects, all the same colour.

What I came up with:
  • use the binary intersection tool, but that only works on (two) paths;
  • use the land layer to clip the underlying TZ zone layer, but the land layer is way too complex (25k paths) for that.

A final idea I have is this: my impression is that the individual objects in the land layer do not cross the borders of the TZ zones. So maybe there is a way to use a single TZ zone path to select all land objects that are in it, and then colour them?

But any other solutions/ideas are welcome! :D
Attachments
map-blue-screenshot.png
map-blue-screenshot.png (75.84 KiB) Viewed 1603 times

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Can I use a path to select all objects laying within in it?

Postby tylerdurden » Mon Nov 28, 2016 1:40 pm

If using each TZ object to boolean-intersect a copy of the map, each result will only be that fraction of the map, so the total file will only be roughly the size of one map and the fifty zones.

Copy/paste map (in place), copy/paste TZ (in place) select both Path>intersection. Repeat 49x with each TZ. Takes <30min?
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Can I use a path to select all objects laying within in it?

Postby tylerdurden » Mon Nov 28, 2016 2:09 pm

Even faster to select map and a TZ, duplicate, path>intersection. (Hide the original map and original TZs when done.)

You will get additional nodes, but far from 50x the number of nodes in the map.

tzSLICESD.svg_-_Inkscape_2016-11-27_23-05-18.png
tzSLICESD.svg_-_Inkscape_2016-11-27_23-05-18.png (141.92 KiB) Viewed 1583 times



EDIT:

I see I have mis-read the post... the important part that there are 25k objects. If they were one big map, the above suggestion could be a solution.

Can the map objects be combined? Or, does the project require they stay separate?
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

a3an0
Posts: 2
Joined: Mon Nov 28, 2016 8:14 am

Re: Can I use a path to select all objects laying within in it?

Postby a3an0 » Tue Nov 29, 2016 8:51 am

Thank you for your help. You directed me in the right direction, but the problem was that I didn't have two paths for creating a binary Intersection, and that the 25k paths of the land part were way too many for clipping.
The breakthrough was that I first had to keep Ungrouping everything in the land layer until I had only paths left, and then Combine all these paths into a single path. I did the same for the various TZ zones (a single path for each of the six colours), and then I was able to perform an Intersection.
The number of nodes became so large that some of the operations took several minutes to complete, but I never received any error message and everything seem to work fine (yay!)

As tylerdurden suggests, all grouping is gone using this method, but that is not a problem (as far as I can see now :-)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Can I use a path to select all objects laying within in it?

Postby tylerdurden » Tue Nov 29, 2016 12:13 pm

Glad to hear things seem to be working well.

I frequently work with paths having thousands (or 10s of thousands) of nodes and yes, the program can take time to process, even with a fast computer. :lol:
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/


Return to “Help with using Inkscape”