Subscribe to this thread
Home - General / All posts - Automatic Thematic Map Refresh After Changing Value?...NEWBIE Question
krash41 post(s)
#27-Apr-16 18:37

Hi Users,

I am manually updating values in map layer that I have applies a thematic format to the feature. Every time I change the value of a record, I want to automatic see the thematic format change. Right now, I found if I select the thematic feature and just click ok, the map refreshes. I looked in the options but did not see any options to auto-refresh.

This is time consuming repetitive manual review of the map and I would like to speed it up a little.

Thank you in advance.

KlausDE

6,410 post(s)
#27-Apr-16 21:34

Is your format based on a numeric value? You could use Continuous Shading then.


Do you really want to ruin economy only to save the planet?

krash41 post(s)
#27-Apr-16 21:54

Yes, the format is based on numeric value. I am not sure what "Continuous Shading" is in Manifold. Is that "Interpolate" between two colours? If so, it would not work for me. I have set the thematic format colour to easily see the erroneous value.

Example:

1: Blue

2: Green

If the original is 1 and I change to 2, I want to see the thematic format automatically shade it Green.

tjhb
10,094 post(s)
#27-Apr-16 23:32

If the original is 1 and I change to 2, I want to see the thematic format automatically shade it Green.

I just checked to make sure, and this is exactly what happens for me, if I change an attribute manually in a drawing (or its table).

Can you give the exact, detailed steps you follow where formatting is not updated automatically?

It might not be important, but this is also unclear:

Right now, I found if I select the thematic feature and just click ok, the map refreshes.

There is no OK button to click after you "select a thematic feature"--if that means selecting a drawing object having thematic formatting. Do you mean double-clicking on the object, bringing up the Object Fields dialog?

krash41 post(s)
#27-Apr-16 23:54

Let me try to explain what I am doing one step at a time. Forgive me for the clumsy descriptions.

Set up: I have a drawing open in a map window and the corresponding table open underneath. The table is filtered to selected.

Step 1: I select a line object in the map window

Step 2: I activate the table window and double click a cell in a table and change a attribute value and hit return.

Step 3: Go back to map window.

Step 4: click on line background theme. See rainbow button in Thematic1of2.jpg attached. (Sorry, manifold does not hold the window prompt when I screen capture)

Step 5: click OK on the next window prompt. See Thematic2of2.jpg attached. This triggers the recount of the thematic unique values.

Step 6: map window refreshed

Attachments:
Thematic1of2.JPG
Thematic2of2.JPG

Graeme

990 post(s)
#28-Apr-16 00:00

Make sure "view/autorefresh view" is checked on. Also double checked. Be careful that you are not being misled by a line being selected and the selection color masking the format color.

krash41 post(s)
#28-Apr-16 00:16

I did check "view/autorefresh view" and is checked on. That was not it.

tjhb
10,094 post(s)
#28-Apr-16 00:26

Thanks for clarifying.

Well, for me, after step 2, the formatting of the selected object is automatically updated. No need for 4 and 5.

Post a .map file?

krash41 post(s)
#28-Apr-16 00:37

I'll try to post a .map file tomorrow. I am rushing this job as I am the bottleneck.

Wondering if running 64bit manifold in 64bit Windows 7 has anything to do with it. I can try using the 32bit manifold to see if it is the same.

tjhb
10,094 post(s)
#28-Apr-16 00:43

I am using 64-bit Manifold 8.0.29 on Windows 7 64-bit SP1.

krash41 post(s)
#28-Apr-16 17:31

Hey master_tjhb,

Sorry, I had to time out on the conversation yesterday. I was up late rushing and working on my project.

This morning, I was able to create an.map example(see attached) and replicate the issue. I noticed that my earlier step-by-step had two key setup pieces missing.

1. the drawing table had a linked attribute that changes the thematic formatting.

2. the column value that I change on the drawing table will alter the linked value which the thematic is based on

So here is modified step-by-step referencing the .map file

Set up: Open map window and the LineDrw table window. The table is filtered to selected.

Note that LineDrw table is linked to the LkUp_tbl table by "code" column

Step 1: Activate the map window and select a line object in the map window

Step 2: Activate the table window and double click a "code" value in a table and change a different attribute value(between 1-3) and hit return. The linked "colour" value will automatically change but if you noticed on the map window, only the label changes but the thematic colour stays unrefreshed.

Step 3: Go back to map window.

Step 4: click on line foreground theme. It will recalculate the thematic count.

Step 5: click OK on the next prompt window prompt.

Step 6: map window refreshed with new thematic colour value.

See if you can replicate my issue. Am I going crazy or I am going crazy?

BTW, the 64bit Windows comment I made below was just crazy talk or sign of desperate irrational explanation.

Attachments:
LinkedThematicNotRefreshing.map

tonyw
736 post(s)
#01-May-16 06:48

Hi Krash,

Interesting technique using the lookup table, I need to take a closer look to see how you did that. Take a look at the attached variation on your map. I thematically coloured the lines based on the value in the field Code. This eliminates your Colour column from any formatting duties. Change the value in the field "Code" and see the colours change. I only went up to 4 in the thematic formatting. I think you can still use the lookup table. Your thematic formatting based on a value in the table should work if the thematic formatting was based on the field you update. I think you can still update your column "Colour" as a step but it's not used in thematic formatting.

Where are you, just noticed you spell "colour" with the "u". I'm in Canada.

Attachments:
LinkedThematicRefreshingOnCodeField.map

krash41 post(s)
#02-May-16 23:46

Hey tonyw,

Looking at your version .map. I notice that on the LineDrw table you inputed an invalid number (i.e. "4") that can not be linked to LkUp_tbl. This seems to crash the refresh of thematic line. Other valid values seems to update.

The project files I am working on, the equivalent "LkUp_tbl" should be unique, complete and valid to be linked to the LineDrw table. I probably need to check if that is the case.

And Yup, Canadian soil...thought that other fellow Canadians would pick that "colour" variation up. Sucks to have no Canadian Team in this year's Stanley Cup.

Dimitri


7,413 post(s)
#01-May-16 08:53

You need to be more precise in telling us what you are doing in each step or we cannot tell for sure.

For example, in your Step 2 when you write

"Activate the table window and double click a "code" value in a table"

You do not say *which* table window of the two tables in your project. Note also there are no fields called "code," just fields called "Code." The first is critical to say, the latter is just to get you into the habit of writing precisely.

For example, you could write:

"Open the LkUp_tbl table and double-click on the Code cell in the second row, changing it from 2 to 3."

My advice is to open the drawing and the labels components in their own windows and zoom out far enough so you can make the windows small enough to fit on your desktop. You can then open the table windows and resize them to have both tables open on your desktop at the same time as your drawing and labels window. To avoid confusion do not use the map and do not mess with selections since they don't have anything to do with the relations but can just confuse you.

The main thing that I see in a quick review of your project is how you have formed your relation between the tables, where the LineDrw Table has a column in it, Colour, that is brought in as a relation from LkUp_tbl. That column is brought in by matching the values in the Code column in the LkUp_tbl table to the values in the Code column in the LineDrw Table table. You are bringing in a Colour value via the relation and the key field you are using to do that, that is, to match up what is in the origin table to the destination table, is the Code field that is common to both. Note from the Relations topic in Help:

A relation between tables uses a key field with unique values common to both tables

The Code field in both tables is your key field. It must have unique values common to both tables. That means that given the way your tables are set up you really cannot make any changes in the Code column in either table.

Consider the third row in the LkUp_tbl table: if you change the Code value in that row from 3 to 2 you violate the constraint that the Code values are unique, because you end up having two records both with a 2 in the Code field. No go. If you change the Code value in that third row from 3 to 4 you satisfy the constraint that the values for the key field, Code, are unique but now the values for Code are no longer common to both tables since the receiving table, the LineDrw Table table, has no record with a value of 4 in the Code field.

The above means your step "change a different attribute value(between 1-3) and hit return."

... is an error if you mean the LkUp_tbl table, at least until you edit some other record to restore order. For example, suppose in the LkUp_tbl table you edit the Code value in the third record to change it from 3 to 1. The green line disappears in the LineDrw Table table and also in the drawing because the relation has been broken. Suppose now you edit the first row in the LkUp_tbl table to change the value of Code from 1 to 3. The green line reappears and all is correct because the relation has been re-established.

That the above works, ie, that you can break the relation and then Manifold will heal it, is surprising and not to be expected. For example, if you break the relation by changing the Code values in a similar way in the LineDrw Table table and then try to unbreak it, that won't work.

I don't know what the business or technical problem is that you are trying to solve by using this approach. If you tell us about that perhaps someone on the forum can suggest alternative approaches, such as using queries. Relations are fine for many things but a situation where people may be interactively editing the key fields used to bring a relation into a table from another are probably not a good use of them given the uniqueness and commonality constraints on the key field in both tables.

tjhb
10,094 post(s)
#01-May-16 09:08

Very nice Dimitri. Perfect really. Makes great reading.

By the way (since I've just done so) do many people here listen to Melvyn Bragg's In Our Time podcast? This week's programme (hardly off-topic at all) was on Euclid's Elements, highly recommended.

RonHendrickson
283 post(s)
#01-May-16 17:15

Thanks for the info, listening to it now. Saved it to my Favorites folder.

KlausDE

6,410 post(s)
#01-May-16 10:57

So your wording wasn't all wrong but instead of the LINK you used a RELATION. Let's try it with a Link:

I have extenden the Lookup Table to cover [Code] 1..6. Not all of the Codes occur in LineDrw at present.

I have deleted the Relation and created a query [LineLkUp Query] and check for errors

-- SQL [LineLkUp Query]

OPTIONS COORDSYS("LineDrw" AS COMPONENT);

SELECT [LineDrw].[Code][LkUp_tbl].[Colour][LineDrw].[Selection (I)][LineDrw].[Geom (I)] 

FROM [LineDrw] LEFT JOIN [LkUp_tbl] ON [LineDrw].[Code] = [LkUp_tbl].[Code];

  • I then did menu->File->Link->This Project->Drawing and selected [LineLkUp Query] as data source.
  • I have created thematic formating temporarily in the resulting [LineLkUp Query 2] adding an object to [LineDrw] for every [Code] in [LkUp_tbl].
  • I deleted the temporary objects from [LineDrw].
  • Beware to open the formating dialog on line foreground color in the linked drawing again. It will be reset to the actually present Unique Values in [Code]
  • To add or delete objects you must use the original [LineDrw]
  • But to edit [Code] in [LineDrw] (or [Colour] in [LkUp_tbl]) you can use the linked drawing and it's table.
  • Changes are only visible after Refresh Data of [LineLkUp Query 2] or its table. That's quickly done with <ALT><F5>

Note that I have added thematic formating of line thickness on [Selection (I)]. So it's easier to see objects that you may have selected for some reason in the original [LineDrw]without overruling the [Colour] by selection color.

Attachments:
LinkedThematicRefreshingOnCodeField.map


Do you really want to ruin economy only to save the planet?

krash41 post(s)
#03-May-16 00:51

Thanks KlausDE,

I ran out of time today to look at your example. I will look at it and see your magic.

You haven't disappoint me yet and don't see that happening anytime soon either.

krash41 post(s)
#03-May-16 18:28

Very elegant, KlausDE.

It does speed up the process very nicely, resolves issues and highlights values beyond 6(error) as Pink(default thematic colour). I like the bonus Selection (I) highlight piece.

And Yes, I misused "Link" as "Relation"....I am getting more familiar with these terminologies.

I am comfortable with SQL queries involved with tables but I like to learn more on queries based on drawings. I will search and read more in this forum.

krash41 post(s)
#03-May-16 00:37

Hi Demitri,

Thanks for the pointer but I thought that I was concise enough by first setting up the project by letting the reviewer know to open only two windows:

"Set up: Open map window and the LineDrw table window. The table is filtered to selected."

Meaning that my steps only uses the two windows and that the LkUp_tbl(short for lookup table) is not to be touched during the example steps.

I do agree that I need to be more precise on my spelling(cap or not). Some languages require precision on the spelling. When I ran SQL queries in Manifold it does not care about caps or not. I know that sloppy coding can introduce errors in programming. More things in my improvement list.

You made a good point to make sure that my two linked tables should contain common values. This may cause the refresh to not update. However, seems to retheme after steps 3-6.

My project requires me to check for reasonableness in the attribute values. I created a thematic theme to highlight lines that should "blue" but showing "red". So when I change the erroneous red into blue line, then it is corrected. That's where the refresh gets stuck until I do that patch refresh steps 3-6. It is not a big deal as I can carry on with my work. It just slows my progress down.

Dimitri


7,413 post(s)
#03-May-16 10:30

my two linked tables should contain common values.

The mild imprecision implied by the above can lead to the sort of problems experienced.

It is risking a misunderstanding to refer to the tables as being "linked" given that a "linked" table is specific nomenclature within Manifold that means something else. You don't have a linked table in your project but instead you have a relation in a table. See http://www.georeference.org/doc/relations.htm as opposed to http://www.georeference.org/doc/linking_tables.htm

The "should" word also risks misunderstanding through imprecision. Relations in tables have fixed rules that you *must* observe. There's no "should" about them. If you do not observe those rules you cannot expect it to work at all. As noted in the Relations topic above:

A relation between tables uses a key field with unique values common to both tables to connect the two tables.

Your key field must contain common values and they must be unique. Those requirements are not options that may or may not be observed based on one's preferences, but instead they are absolute, non-negotiable requirements which are fundamental to what relations are and how they function. In any situation where either one, or both, of those two criteria are not satisfied there's no utility in wondering why something happens sometimes but not other times... that's just trying to puzzle out different ways in which something that is broken behaves when it is broken. The solution, of course, is to not break it in the first place by making sure the relation is done correctly.

If your project requires you to check for reasonableness perhaps you should use lookup values or some other method, as relations are probably not the best choice in this situation.

Regarding...

letting the reviewer know to open only two windows

You are right, that is a true reading, of course, but there are other possible readings too.

You do, after all, follow the quoted sentence with a very next sentence that mentions two tables. In English, a subsequent reference to "the table" normally refers to whatever came immediately prior, an ambiguous situation in this case where what comes immediately prior is two tables. It's not guaranteed that "Set up: [...]" was intended to overrule the possibility that your later sentence meant to open the other table as well... something that must be considered absent explicit commentary to the contrary.

[If I had a dollar for every time a statement was mistakenly assumed to mean only one thing and not another nuance, well, I'd be retired and sitting in a dacha in France right now, watching my gardener trim the lawn and bringing the tulip beds to order. :-) ]

In any event it is best not to expect that volunteer helpers will always know when something was intended precisely and when something was intended less precisely, especially given that many of the volunteers in this forum (like me) learned English as a second language. Make it easier for readers to be in sync with you by making every step explicit. You are well on the way to that already.

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