Convert Vector to Raster - Projected Coordinate System (X and Y) but NOT Geographic Coordinate System (lat and lon)
Show older comments
Hi
I have polylines in a projected coordinate system (X and Y). I would like to convert these vector data to raster data.
I used 'vec2mtx' but get errors because my projected values are NOT within -90 and 90 or −180 and 180]. My values are around 510000 for X (False_Easting) and 6023150 for Y (False_Northing)
I tried to fix vec2mtx but it did not work.
Is there another function, tool or whatever which I can use? Do you have any idea how to convert vector projected map data to raster data?
Thanks a lot, any suggestion is more than welcome
Cheers
Claudia
8 Comments
Walter Roberson
on 9 May 2012
What range of input values are needed for X and Y, and how finely grained do you want the raster data to be?
Claudia
on 9 May 2012
Walter Roberson
on 9 May 2012
At 1 grid cell per 10 meters, that range of X and Y would need a grid of 62748 x 76633 which would require about 4 1/2 gigabytes at one byte per grid cell. That would require very careful management if you are using a 32 bit version of MATLAB (those usually cannot construct an array of more than about 800 megabytes in practice.)
Q: What do you want to have happen when the vectors cross or touch?
Q: Are the vectors to be different colors?
Q: What will you do with the raster data? For example, could you just plot() using vector coordinates and getsnap() the resulting axes image? Though if you do that, you are going to need somewhere on the order of 750 meters per pixel or worse.
Claudia
on 9 May 2012
Walter Roberson
on 9 May 2012
MATLAB is not designed to store values by bits; the storing and retrieving has to be done mathematically or by using the bitset() and bitget() calls (which tend to be slow.) The smallest logical data type in MATLAB is "logical", but that is presently implemented at one value per byte (except I think I saw one special case might internally be stored at 8 logical per byte.)
How dense are you expecting the result to be? 25000 lines on a grid that size doesn't sound like much at first thought. If you expect a lot of empty area, then using a sparse array of logical might be suitable.
Box counting... that sounds to me as if it could be done piece-wise? If you were to divide the logical output grid into a number of tiles, and do the drawing one tile at a time, then could that be productive? I suppose you might need an overlap area if the boxes are sliding smoothly.
Do you have an estimate for the longest straight line segment (in meter) ? The shorter the lines are, the more effective preprocessing can be at reducing the cost of constructing fine details for a section.
Claudia
on 10 May 2012
Walter Roberson
on 10 May 2012
Why not divide the data by 10^5 to get it into the range accepted by vec2mtx ?
Claudia
on 11 May 2012
Answers (0)
Categories
Find more on Data Import and Export in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!