AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating Contours from a .tif - Why are my contours closing?

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
dhouleAVYFD
1442 Views, 15 Replies

Creating Contours from a .tif - Why are my contours closing?

Hi, 

I'm trying to create contours from a .tif that I imported using Data Connection.  I've watched several videos on how to do this and each time after using the "Create Contour Layer" command the initial contours are created, the contours reach to the end of the .tif and stop.  Mine, form a closed polyline that is driving down to 0 ft.   Does anyone know why mine does this and others don't.   

First image shows what I'm expecting to see. Second shows what I'm actually getting.

Test 7 Good.PNG

Test 7.PNG

  

I'm not sure why I get the apron around my site (Green Pic).  I've tried clipping the area but the apron continues to be there.  I used QGIS to do the clipping.

I'm new to all this.  I'm trying to get a better handle on how to use efficiently GIS data from different sources.

 

Thanks 

 

Labels (6)
15 REPLIES 15
Message 2 of 16
Pointdump
in reply to: dhouleAVYFD

Hi Danny,

"...form a closed polyline that is driving down to 0 ft."
I keep looking at your 2nd pic, but I still don't understand.
What version/year is your Map 3D/Civil 3D? Do you have all updates?
Can you post a link to your original data?
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
Message 3 of 16
dhouleAVYFD
in reply to: Pointdump

Hi,
I'm using Civil3D 2020, updates are up to date.
The red frame around the contours are actually contours that drop off
quickly.
My expectation is that the contours in red will just stop at one point
because they are a cut out of a larger area. Instead they loop back and
form closed polylines.

I've uploaded the data that I was using to the below Google Drive.

https://drive.google.com/drive/folders/1GhhHCh6A-ieCTsyE14GYW8_aEuu1vxXx?usp=share_link

Thanks
Message 4 of 16
Pointdump
in reply to: dhouleAVYFD

Danny,
Thanks for posting your data.
Wow, I've never seen this before. I created a surface in Civil 3D with your Tiff, and look at this edge.
Dave

 

EqTiff_1.png

 

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
Message 5 of 16
Pointdump
in reply to: dhouleAVYFD

And creating contours in QGIS produces this:
Dave

 

EqTiff_2.png

 

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
Message 6 of 16
dhouleAVYFD
in reply to: Pointdump

Hi Dave,
Thanks for taking a look at this.
I've also taken a very small sample from the middle of the .tif and got the
same results along the edge. Still can't figure out why it's grading down
to an elevation well below the surface.

Danny
Message 7 of 16
parkr4st
in reply to: dhouleAVYFD

finish the task.  mapimport the contours with OD, save the dwg, attach to a new map, set CS, query in all and alter properties Elevation:elevation@contour and draw/execute.

 

The lines will be at elevation and you will see the ends of the lines that go down in your work and cause concern are now at elevation, i.e. horizontal.  

 

TRIM those ends off if you don't want them.

 

see attached dwg.

 

Dave

Message 8 of 16
ChicagoLooper
in reply to: dhouleAVYFD

Hi  @dhouleAVYFD 

Las Cruces, correct?

 

The collar of the raster (what you refer to as the apron) does not represent the surface of the earth and contains no elevation value. Therefore it will default to 0 feet above mean sea level if it's included during the creation of your contours.

 

To use your raster and create contours that won't drop down to 0ft, add your raster as a Feature Data Object (FDO) connection, then do this.

 

  1. Draw a rectangle like the red dashed line. Your rectangle may vary. If you only need a portion of the raster you may draw a smaller rectangle to reduce the area required to generate the contours. See image-1.Image-1Image-1

 

  1. Zoom in so the red dashed rectangle is barely off-screen. You only want to 'capture-the-view' for the portion of the raster you need. The parts you don't need, such as the collar, must be off screen and out-of-view. Then go to the Map Task Pane and select the raster=>Right-click=>Resample raster. See image-2.Image-2Image-2

 

  1. Zoom out. The raster parts that were off screen have been cut off. The resampled raster is limited to the part that was viewable before you clicked 'Resample raster.' See image-3. Image-3Image-3

<<The cut off portion has NOT been deleted, it's hidden. To make the hidden part reappear, zoom out, way out(!) so the entire raster can 'fit' in the viewable area of modelspace. Use judgement to determine how far you must zoom out. Next, right click the raster in the Task Pane=>select Resample raster. If the original raster is able to 'fit' inside this new zoomed out 'viewable' area, it will resize itself to its former size which, of course, will include the collar.>>

 

  1. Right click the raster in the Task Pane=>Create contour layer. See image-4.Image-4Image-4

 

  1. Make your selections for your contours (your parameters may vary). Name your contours, e.g. Contours_20ft.sdf, and save your contours in your project folder. The contours will be saved in SDF format (.sdf extension). Unfortunately, Map3D does NOT give any other option besides SDF format when creating contours from your raster. See image-5.

Image-5Image-5

HINT: Add '_20ft' to the end of your contour's name so it includes the contour interval you specified. Your contour interval may vary.>>

 

6.The contours will be automatically added to modelspace ( depending on the size of the resample, it may take a few seconds for the contours to generate). You may control the appearance of these contours in the Style Editor by selecting the contour layer in the Task Pane=>Click the Style icon at the top of the Task Pane. See image-6.Image-6Image-6

 

 

NOTES:

  1. If you don't like SDF format, then take the advice the advice from @parkr4st who suggests using MAPIMPORT command to import the SDF contours to your drawing. This command will convert the SDF vectors to plain vanilla AutoCAD polylines.
  2. If your goal is to create a TIN surface in Civil3D, then you must also combine the following during MapImport: (A) create Object Data and (B) select Alter Properties. Object Data will capture each individual contour elevation and Alter Properties will physically raise the contours from 0ft to their proper elevation. 
  3. If you use the Civl3D command named Create Surface from DEM using the raster uploaded in Post #3 of this thread AND use New Mexico, Central Zone, NAD83, State Plane-Feet as your coordinate system, then your elevations will be too high because this Civil procedure, when used on this specific raster, will increase the TIN elevations by a factor of 3.2808. OTOH, if you use NSRS11.UTM-13 (EPSG 6342) which is the native coordinate system of the raster, then the elevations will be accurate, but at the same time, the x,y coordinates will be in meters, and that means when you choose EPSG 6342 you're now drawing in meters and not feet.  

 

Chicagolooper

EESignature

Message 9 of 16
dhouleAVYFD
in reply to: dhouleAVYFD

Thanks to everyone for the help!  

Message 10 of 16
braudpat
in reply to: dhouleAVYFD

Hello

 

When you have 2D PLines with Elevation as Object Data, you can elevate quickly

Plines to the right Z with a Lisp routine "OD2DXF38" ...

 

Thanks to @CADaSchtroumpf / Bruno for this beautiful routine !

 

The Health, Bye, Patrice (The Old French EE Froggy)

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 11 of 16

Hi ChicagoLooper. Your advice is fantastic by the way. What if your collar is not a rectangular shape, rather a crazy polygon shape? I am getting contours dropping all the way from 15 to -10000 meters, all around my .tif file.

Message 12 of 16
Pointdump
in reply to: ap-australia

Hi Hieu,
Can you post your crazy Tiff?
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
Message 13 of 16

@ap-australia 

<<...What if your collar is not a rectangular shape, rather a crazy polygon...>>

 

It sounds like you're dealing with drone captured data where the pilot only flies the minimal area, just enough to cover the necessary area. Why pilots can't fly more than the needed area is beyond me. Maybe it's a battery issue. Batteries are heavy and the smaller and lighter the battery the better. To keep the weight down, fly times may only last 15-20 minutes when using lighter batteries. I've spoken with licensed pilots who operate drone/software packages exceeding 6-figures, where the software itself accounts for +75% of the cost. No, no, it's not the kind of drone you buy from an online retailer! 

 

You still might be able to do it if your 'area' that you want contours can be defined by a rectangle AND that rectangle can comfortably 'fit inside' the crazy polygonal shape. If you need the entire polygonal area then your options are limited.

 

  • You can create sections, or tiles, of the original polygon so the individual tiles, as a whole, comprise the original. Then create contours for each tile.
  • You can use third party software that can handle your crazy polygonal-shaped raster images that AutoCAD cannot understand. Then you can export from that software to an Acad friendly format which you insert into modelspace.
  • You can find another source with the same data that has a rectangular shape.
  • You can ask the data's author for a rectangular shaped raster.

 

Chicagolooper

EESignature

Message 14 of 16

Thanks.

 

Yes, it is drone data and an irregular shape which represents the parcels of land requested. When the .tif/DEM file is imported into AutoCAD Map 3D, it applies an apron around the polygon area of data and gradually drops the elevation values to -9999 and then fills in all the blank space within the North/East/South/West parameters of the .tif. Therefore, when I generate 1m contour intervals I get 10000 contour lines surrounding the polygon shaped .tif data, which is a pain and slows down my machine.

 

I'm working through generating the contours in QGIS which doesn't apply contours around the apron of the .tif, it's just proving hard to get the contours 'cleaned up'.

Message 15 of 16
Pointdump
in reply to: ap-australia

Hi Hieu,
Dense contours at the edge, I've seen this before.
Here's some ideas to kick around:
In QGIS use Pixels_2_Points, which gives you a point with elevation at the center of each pixel.
In LASTools use DEM.Zip to convert your Tiff to LAZ point cloud. You might also be able to get your hands on the original point cloud data.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
Message 16 of 16

Hi @ap-australia 

You can eliminate the 'apron' by zooming-IN so the apron is off screen then perform RESAMPLE RASTER. (See post #8.) You'll need to determine how much of the DEM/tif to hide before resampling. Don't be so fast in saying you need every square meter of the tif if you can get away with just 80%-90% of it, e.g. 80% is not 100%.

 

If you're an advanced user, you can resample then create multiple DEM/tif TILES. Then generate contours tile-by-tile.

 

Whatever program you use to create contours, however, your biggest problem sounds like you're freely accepting the default interval. You don't necessarily have to accept that default, you're in control so you can increase it, e.g. 10, 20, or 50 so you'll have fewer contours and an easier time panning and zooming. And since you're in control, you may rerun the contours again at a tighter interval, but not so tight that it diminishes performance.

 

Do you have a small site, for example less than 5,000 square meters? Contrary to popular belief, super tight contours don't add any value to your drawing. It's overkill! A super big subdivision, for example, may only need 5m interval or maybe 10m. If your site is relatively flat, however, then tighter intervals at 2m might be feasible since flat areas generate only a few contours widely spaced apart.

 

You may also consider running 'spaced-out' contours for the overall entire site map and create additional contours when zooming-in on specific parcels. Limiting tighter contours to only certain parcels and not the entire site will improve performance.

 

You can change the interval. You can run as many sets of contours as you wish. You're in control.    

Chicagolooper

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report