• Blog posts

    Bio

    By David Crowther

    MapThat___Data_Editing_and_Apostrophes_-_1.PNG

    Question:

    Is it possible to edit attributes in MapThat to use an Apostrophe?

    Answer:

    This depends on the source of the data being used. In this case we will assume that the source data is stored in a SQL Database.

    Here we have a Wards Table for Liverpool where none of the records currently have an apostrophe in any of the columns.

    MapThat___Data_Editing_and_Apostrophes_-_2.PNG

    When viewed in the Data Table in MapThat the same attribute values are shown:

    MapThat___Data_Editing_and_Apostrophes_-_3.PNG

    We will now try to add an Apostrophe into one of the records using SQL Management Studio. Using the update statement below returns an error message, which is the first indication that SQL has restrictions with the use of Apostrophes.

    MapThat___Data_Editing_and_Apostrophes_-_4.PNG

    In fact to successfully insert an Apostrophe into a record in SQL you need to demote the Apostrophe twice. Here is the correct update statement example:

    MapThat___Data_Editing_and_Apostrophes_-_5.PNG

    Now the record is successfully updated in the SQL Database table with the Apostrophe added to the Name field.

    MapThat___Data_Editing_and_Apostrophes_-_6.PNG

    And MapThat will successfully show the Apostrophe as part of the record.

    MapThat___Data_Editing_and_Apostrophes_-_7.PNG

    What happens when we try to edit this record using MapThat?

    Well if we simply use the Edit Attributes button in the Data Table to change the attributes for any of the other records e.g. changing the Ward Name of ANFIELD to be CADLINE,  that record is successfully amended.

    MapThat___Data_Editing_and_Apostrophes_-_8.PNG

    If we press Save the SQL Database Table is amended with the edits that we made in MapThat.

    MapThat___Data_Editing_and_Apostrophes_-_9.PNG

    However, if we try to amend an attribute in the record that contains an Apostrophe e.g. changing the Ward Name for CROXTETH to be DAVID, we receive an error message as the whole record is being updated into SQL and the single Apostrophe in the Councilors name causes a syntax error.

    MapThat___Data_Editing_and_Apostrophes_-_10.PNG

    So – is it actually possible to edit attributes in MapThat where a record has an Apostrophe within it?

    The answer is Yes – we can use the Edit Attributes Form within the MapThat Drawing Tools.  To do this, from the Edit Tools, choose the Drawing Tools and choose to edit the Liverpool Wards layer.

    MapThat___Data_Editing_and_Apostrophes_-_11.PNG

    Now in Edit mode, we can use the Edit Attributes Form….

    MapThat___Data_Editing_and_Apostrophes_-_12.PNG

    and make a change to this individual record - for example making a change to the Ward Name changing Croxteth again to David.

    Note - that the Edit Attributes form has automatically removed the Apostrophe from within the Councillors Name!

    MapThat___Data_Editing_and_Apostrophes_-_13.PNG

    Once we press Save the edit is successful and if we look in the SQL Database table we can see that we have made the change to the Ward Name to be David. However, as we noticed before, using the Edit Attributes Form has now removed the Apostrophe from the Councillor Name field.

    MapThat___Data_Editing_and_Apostrophes_-_14.PNG

    So, finally is it possible to make the changes to a record that has an Apostrophe and also retain the Apostrophe in the record – or indeed add an Apostrophe?

    Yes – using the Edit Attributes Form we can insert or re-insert an Apostrophe by using two Apostrophes – the same as we would in our earlier SQL Update statement. Now below in the Edit Attribute Form we have inserted an Apostrophe twice in the Ward Name and twice in the Councillor Name.

    MapThat___Data_Editing_and_Apostrophes_-_15.PNG

    If we now press SAVE the edit is successfully made.

    MapThat___Data_Editing_and_Apostrophes_-_16.PNG

    And if we check the record in our SQL Database Table we can see the Apostrophe’s have been added.

    MapThat___Data_Editing_and_Apostrophes_-_17.PNG

    So, it’s up to you!

    MapThat can show Apostrophes in records. It can also allow you to add, remove and retain Apostrophe’s, but you may feel it’s easier to simply remove these from your SQL tables to reduce any possible confusion for your Users.