<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,<br>
</p>
<p>The GDAL/ORG library works with <span style="color: rgb(64, 64,
64); font-family: Lato, proxima-nova, "Helvetica
Neue", Arial, sans-serif; font-size: 16px; font-style:
normal; font-variant-ligatures: normal; font-variant-caps:
normal; font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(252, 252,
252); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial; display: inline
!important; float: none;">Open Design Alliance Teigha library.
They have a support for R13-15, R2004, R2007, R2010, R2013 and
R2018 but since Autocad is a closed format, then all of this is
basically the result of reversed engineering. DXF is an open
format so that is easier to deal with.</span></p>
<p><span style="color: rgb(64, 64, 64); font-family: Lato,
proxima-nova, "Helvetica Neue", Arial, sans-serif;
font-size: 16px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(252, 252, 252); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">I believe
that the drag and drop functions for DWG and DXF uses the
libopencad drivers (and that is limited to r2000 or ACAD1015))
(at least in QGIS 3.20) so if you did drag and drop a correct
file format, then the DWG worked.<br>
</span></p>
<p><span style="color: rgb(64, 64, 64); font-family: Lato,
proxima-nova, "Helvetica Neue", Arial, sans-serif;
font-size: 16px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(252, 252, 252); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">It's my
personal experience that anything past R15 (2000) will be buggy
in QGIS but you can also open those files using the project >
import/export > import layer from DWG/DXF. For some reasons,
some DWG files cannot be dragged and dropped but can be imported
via the project import function. This has the advantage of
keeping the Autocad styling. I guess this function probably uses
the </span><span style="color: rgb(64, 64, 64); font-family:
Lato, proxima-nova, "Helvetica Neue", Arial,
sans-serif; font-size: 16px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(252, 252,
252); text-decoration-thickness: initial; text-decoration-style:
initial; text-decoration-color: initial; display: inline
!important; float: none;"><span style="color: rgb(64, 64, 64);
font-family: Lato, proxima-nova, "Helvetica Neue",
Arial, sans-serif; font-size: 16px; font-style: normal;
font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: 400; letter-spacing: normal; orphans: 2;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(252,
252, 252); text-decoration-thickness: initial;
text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">Open Design
Alliance Teigha library and not the libopencad drivers as it
will open files that I cannot drag and drop??? Looks like
those functions are not available via the python API nor the
Processing toolbox either:(<br>
</span></span></p>
<p><span style="color: rgb(64, 64, 64); font-family: Lato,
proxima-nova, "Helvetica Neue", Arial, sans-serif;
font-size: 16px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(252, 252, 252); text-decoration-thickness:
initial; text-decoration-style: initial; text-decoration-color:
initial; display: inline !important; float: none;">Anyways, when
that fails (about 50% of the time on very big files), I save the
DWG to DXF and that either fixes the file or makes it more
compatible with the driver. IMHO, Exporting dwg to shp file is
the only real interesting feature of AutoCAD Map3D. The last
version I regularily worked with has probably 2013-15 so maybe
they have updated the product since.<br>
</span></p>
<p><a class="moz-txt-link-freetext" href="https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/AutoCAD-drawing-file-format.html">https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/AutoCAD-drawing-file-format.html</a></p>
<p><a class="moz-txt-link-freetext" href="https://docs.qgis.org/3.22/en/docs/user_manual/managing_data_source/opening_data.html?highlight=dwg#importing-a-dxf-or-dwg-file">https://docs.qgis.org/3.22/en/docs/user_manual/managing_data_source/opening_data.html?highlight=dwg#importing-a-dxf-or-dwg-file</a></p>
<p>Nicolas<br>
</p>
<div class="moz-cite-prefix">On 2021-11-21 11:06 p.m., Jeff
Sonnentag wrote:<br>
</div>
<blockquote type="cite"
cite="mid:BYAPR10MB29983E1BBB14CF274A9E9CC1D79F9@BYAPR10MB2998.namprd10.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Consolas",serif;}span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Courier New";
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New"">Somebody
must get the same quality of “engineering” that we do here.
:D<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New"">The
last item received was in feet and aligns with California
State Plane Zone 6, but they chopped off the first digit of
both “X” and “Y” for everything. Who knows why. Maybe
things run faster for them with 6 digit coordinates rather
than 7 digit ones like you mentioned. (???)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New"">Anyway,
when I tried the simple drag and drop into QGIS 3.22 it
never worked. Always an error message about invalid data,
even after I used DWG Trueview to convert it to the oldest
possible versions (97/98 and 2000). I did manage to get it
in AFTER converting the DWG to a DXF with an online
conversion site. That DXF could be drug (I hate the word
“dragged” – seems along the lines of “runned”) into QGIS and
appeared OK. Export to a shapefile and then do some affine
adjustment magic and things can be worked with.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New"">Is
there a reason that a DWG can’t be dropped into QGIS 3.22
but a DXF can? Are there some DWG versions that just don’t
work? I thought I got a DWG to appear OK in 3.16, but maybe
I just imagined it and used a DXF before too. . . .<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Qgis-user
<a class="moz-txt-link-rfc2396E" href="mailto:qgis-user-bounces@lists.osgeo.org"><qgis-user-bounces@lists.osgeo.org></a> <b>
On Behalf Of </b>Bernd Vogelgesang<br>
<b>Sent:</b> Sunday, November 21, 2021 10:53 AM<br>
<b>To:</b> Nicolas Cadieux
<a class="moz-txt-link-rfc2396E" href="mailto:njacadieux.gitlab@gmail.com"><njacadieux.gitlab@gmail.com></a>; Greg Troxel
<a class="moz-txt-link-rfc2396E" href="mailto:gdt@lexort.com"><gdt@lexort.com></a>; Boaz Bar Ilan
<a class="moz-txt-link-rfc2396E" href="mailto:boazprosie@gmail.com"><boazprosie@gmail.com></a><br>
<b>Cc:</b> qgis-user <a class="moz-txt-link-rfc2396E" href="mailto:qgis-user@lists.osgeo.org"><qgis-user@lists.osgeo.org></a><br>
<b>Subject:</b> Re: [Qgis-user] importing dwg/dxf<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 21.11.21 15:35, Nicolas Cadieux wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi, <br>
<br>
.dwg or dxf have no CRS. They can be in inches, feet, mm,
cm, m... Usually meter in a local CRS like a local WGS84 UTM
ZONE is used. You can usually find this in the metadata if
available.
<br>
<br>
Nicolas <o:p></o:p></p>
</blockquote>
<p>I have no deep technical insight into dwg or dxf, but I am
pretty sure that those CAD-"products" are able to be produced
with valid coordinates, fitting to a common CRS. Most people
using CAD-systems simply seem to be either too stupid for
that, or just do not care.<o:p></o:p></p>
<p>One of the reasons, CAD-"data" is produced with a local
reference system instead with a normal CRS is, according to an
CAD-operator I once asked about this, that some CAD-systems
just slow down to in-operability when using real-world
coordinates because of the huge numbers, compared to the small
coordinates in their own system.<br>
<br>
So, I would not even try to fix this, but instead ask those
guys to stop scratching their balls and better send you proper
real-world data and tell you which CRS they are in . The
handling of this "data" is punishment enough afterwords.<o:p></o:p></p>
<p>Hope my dislike for this "technology" was not too obvious ;)<o:p></o:p></p>
<p>Cheers,<o:p></o:p></p>
<p>Bernd<o:p></o:p></p>
<p><o:p> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><br>
On 2021-11-21 9:07 a.m., Greg Troxel wrote: <br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Boaz Bar Ilan<a
href="mailto:boazprosie@gmail.com"
moz-do-not-send="true"><boazprosie@gmail.com></a>
writes:
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">i always have problem importing dwg
or dxf . the layers dont fit the
<br>
coardinations and even when i set the layers crs it
doesnt work. <o:p></o:p></p>
</blockquote>
<p class="MsoNormal">I am far from an expert, but recently
tried to deal with a dwg.
<br>
<br>
My impression is that they are almost always in local
coordinates, and <br>
the path to success is something like using GeoScience
plugin to define <br>
a local CRS based on control points where you know global
coordinates <br>
and local, and then to use that CRS for the data. <br>
<br>
I recently imported some "PNEZD" data (csv with point it,
northing, <br>
easting, vertical, and description, all in an unspecified
local grid, <br>
from a total station data collector) and used geoscience
to align it <br>
wtih RTK obsservations of a few points, and things fit
quite well. <br>
<br>
How are you getting dwg? Are you using the proprietary
dwg library with <br>
gdal, or is there some open source path? <br>
<br>
_______________________________________________ <br>
Qgis-user mailing list <br>
<a href="mailto:Qgis-user@lists.osgeo.org"
moz-do-not-send="true" class="moz-txt-link-freetext">Qgis-user@lists.osgeo.org</a>
<br>
List <a
href="info:https://lists.osgeo.org/mailman/listinfo/qgis-user"
moz-do-not-send="true" class="moz-txt-link-freetext">info:https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
<br>
Unsubscribe:<a
href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Qgis-user mailing list<o:p></o:p></pre>
<pre><a href="mailto:Qgis-user@lists.osgeo.org" moz-do-not-send="true" class="moz-txt-link-freetext">Qgis-user@lists.osgeo.org</a><o:p></o:p></pre>
<pre>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre>
<pre>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre>
</blockquote>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Nicolas Cadieux
<a class="moz-txt-link-freetext" href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a></pre>
</body>
</html>