Subscribe to this thread
Home - General / All posts - Table to Drawing
BerndD

162 post(s)
#27-Feb-17 22:42

In Radian I created a new table based on two geometry tables

SELECT [osm_id],[name],[ref],[type],[Geom]

INTO [strassen RP tue stgt2 Table]

FROM

(SELECT *

FROM [roads Table]

UNION ALL

SELECT *

FROM [roads Table 2]

)

;

Then I tried to create the drawing for that table

CREATE DRAWING [Table Drawing 2]

(

PROPERTY 'FieldGeom' 'Geom',

PROPERTY 'Table' '[strassen RP tue stgt2 Table]'

)

;

Unfortunately I don't get a drawing with geometry in it. It's empty.

In an ideal world I would like to combine these two steps.

Any suggestions why this is not working and how it could be solved?


Organizations that want to adapt to CHANGE are using products that can adapt.

www.yeymaps.io

tjhb
10,094 post(s)
#27-Feb-17 23:00

Bernd,

I think you will need to set the FieldCoordSystem.<geom field> property [name corrected] for the newly created table, before the drawing will be able to show anything.

It doesn't matter whether you do this before or after creating the drawing.

Tim

tjhb
10,094 post(s)
#27-Feb-17 23:21

E.g. to assign a coordinate system from a given <epsg_code>

ALTER TABLE [strassen RP tue stgt2 Table] (

ADD PROPERTY 'FieldCoordSystem.Geom' CoordSystemEpsg(<epsg_code>)

);

or, to apply from the existing [roads Table]

ALTER TABLE [strassen RP tue stgt2 Table] (

ADD PROPERTY 'FieldCoordSystem.Geom' ComponentProperty([roads Table]'FieldCoordSystem.Geom')

);

If the named property already exists, ADD PROPERTY will overwrite the current value. (You don't need to use DROP PROPERTY first.)

adamw


10,447 post(s)
#28-Feb-17 07:48

The window shows nothing except a small red icon in the bottom right corner, correct? That icon indicates that you have system messages. To view them, invoke View - Messages (F7). You should see a message stating that you are missing an RTREE index with an invitation to build a temporary one. Build a temporary index to see the objects, or, better yet, build a persistent index (RTREE on the geom field) using either Edit - Schema on the table or using ALTER TABLE.

(Transferring the coordinate system like Tim shows is obviously also a good idea. Also, instead of creating a new table from scratch you could have made a copy of one of the tables using copy/paste and appended data from the second table using INSERT ... SELECT ... Copying and pasting would have created the index and transferred the coordinate system automatically.)

tjhb
10,094 post(s)
#28-Feb-17 08:06

So much better, whew. That was me missing the most important thing as usual!

Dimitri


7,413 post(s)
#28-Feb-17 09:25

See

Example: Add a Spatial Index to a Table

as well as

Example: Create a Drawing from a Geocoded Table

Some useful background and a diagram in

Example: Drawings use Geom Fields in Tables

Dimitri


7,413 post(s)
#28-Feb-17 11:52

Ah, one other idea: to learn how to create drawings that use tables in SQL, with all the salad dressing required, you can't beat using the Add component choice and the Edit Query button in the Transform dialog to see what SQL Radian creates to do that.

See, for example, the topic at SQL Example: Learning to Union Areas in SQL from Edit Query which shows a query being written for you that creates a table and a drawing with all the details covered.

BerndD

162 post(s)
#28-Feb-17 21:51

Thanks everbody,

That did the trick. So many choices, but that's normally a good things.


Organizations that want to adapt to CHANGE are using products that can adapt.

www.yeymaps.io

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.