|
Easy, depending on what it is you mean by "point." A "point" is a specific type of object in Manifold but I don't know if you are using this word precisely or if you are using it less precisely as a synonym to mean location, a particular place, etc. How you approach the matter depends on what you mean. Case 1: "Point" means point object in Manifold. In this case, what do you mean by Each point can have as many as 20 names associated with it ? If by that you mean that each point can have many data attributes giving possible names, then the solution is simple. Create a labels component and in the Text box cite each of the attribute fields that can be used for names so that each name appears in the same label on a different line, just like the example in the Creating Labels from Fields help topic. Another way of doing this is to use the transform toolbar to concatenate all the different fields that might hold names into a single field and then use that field in the label. This would put all the names for the same point on one line in the label. Case 2: "Point" means the same location, such as a city. I'm guessing here, but I suppose what you mean is that after you geocode your data set you end up with a bunch of point objects at the same location and that each of those has a different name. I'm guessing that when you create labels for those different point objects using each point's name field you end up with a bunch of labels that overlap each other. This is trickier but still can be done and you probably won't even have to use SQL. How you go about doing it depends on the structure of your data. For example, are all of the point objects representing the same city located at identically the same lat/lon coordinates? Or, is it because the city data you are using arises from several different sources that the point objects you end up with are approximately in the same location for each city but are not exactly coincident? Begin by making backups of all starting data. :-) Suppose it is the former, that all the different points for a city exactly coincide. Open up a table and turn on the lat/lon (I) intrinsic fields. Select all duplicates except the first using, say, Longitude (I) [assuming no longitude is identically the same for different cities, a safe bet if the data is at all precise] and then cut them and save them to a new drawing. You now have a drawing that has only one point in each city with a name field, say, called Name, and you also have a drawing with all the duplicates. In the drawing with unduplicated points create a buffer zone area around each point [choosing a distance such as 1000 meters that will capture all points for the same city but won't overlap with any other buffer zone], transferring the values of all fields into that buffer zone. This area will be a convenient scratchpad used to transfer values. In the drawing of duplicates change the Name field to Name2. Again, select all duplicates except the first for Longitude (I) in that drawing and now Invert the selection. Cut those and paste them back into the first drawing. You now have the original drawing that had no duplicated points, but you've also added one duplicate to some of those points where the duplicate uses a field name of Name2. Transfer the Name2 values from those points with a value for Name2 into the buffer zone area objects that contain them. Now, delete those points with a value in Name 2. Next, transfer the Name2 values from the buffer zone area objects into the Name2 field (up to now, empty) for the points contained by each buffer zone. Use the transform toolbar to concatenate the names from the Name2 field into Name and after doing that clear the values in Name2 for both points and buffer zone objects. So now some of the points have a longer string in Name that consists of two names. Go back to your drawing that has the duplicates. Once again select all duplicates except the first on Longitude (I) and cut those. Paste them back into the first drawing. Now you've added a bunch more new, coincident points with a value in Name2. Once again transfer those Name2 values into the containing buffer zone areas and then delete those points with values in Name2. Once again transfer the Name2 values from the buffer zone areas into those points contained by each area. Concatenate those onto Name and delete the Name2 values from points and areas. You now have a drawing of points where some of those points have three names in their Name string. Repeat that process until you've run out of duplicated points in that second drawing, and then you are done. You can now create a label for each point and it will list all the names in that Name field. Note that the above process works no matter how many points you have. If you have 1,000,000 points you don't have to do it 1,000,000 times: you only have to do it to whatever "depth" of duplication you might have. That is, if you can have up to 20 points located at the same spot representing the same city you only have to do it 20 times, as the sifting works regardless of how many particular cities are duplicated or how many cities there are. If you have a situation where the points representing a city are near each other but not exactly coincident, you can't use the simple trick of using the transform toolbar to select all duplicates except the first using the Longitude (I) field. That's a bit trickier. You being the same way to assure yourself you have a set of points where none are exactly coincident, and then you create a small buffer zone about each and then you use that buffer zone to select all that are contained within that buffer zone, giving each object thus selected some attribute value that marks it as a member of that same city. You can then do the all duplicates but first trick using that attribute value. A caution: the above is a thought experiment, not a report of each step actual done in real life. But it shows one possible approach. Another approach would be to accomplish the above through elegant SQL; however, writing the exact SQL depends on the exact structure of your data.
|