Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0135 annotating point in canvas #413

Merged
merged 14 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions recipe/0135-annotating-point-in-canvas/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Annotating a specific point of an image.
id: 15
layout: recipe
tags: image
summary: "This recipe explains how to annotate a specific point of an image."
viewers:
topic:
- Annotations
- property
property: PointSelector
---

## Use Case
I want to annotate a coordinate of the image rather than a region. I have a map with some locations that can be represented better by a single coordinate. I want to add some auxiliary data relative to a specific point of the image (e.g. some spectroscopic analysis made on a manuscript).

## Implementation notes

This recipe, as [Simple Annotation — Tagging][0021] implements a method for annotating an image. Recipe [Begin playback at a specific point - Time-based media][0015] uses a Point Selector for selecting a specific time of a video this recipe selects instead a specific point of the image.

In this use case, the Annotation is inside an Annotation Page in the `annotations` list of the Manifest. The `motivation` of the Annotation is "tagging" and the target `source` points to the Canvas `id`. The `type` property is a Specific Resource while the Selector `type` property is a Point Selector that contains the coordinates `x` and `y` of the Canvas coordinates system as parameters.

Viewer might consider implementing scale-independent point markers so that they are visible at every level of zoom.

## Example

This example uses a leaflet with a map and a guide supplied by the Library of Congress Geography and Map Division, it shows how we can annotate some locations expressed in the map.

{% include manifest_links.html viewers="" manifest="manifest.json" %}

{% include jsonviewer.html src="manifest.json" config='data-line="75-83"' %}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is going on but it looks like this commit wasn't applied for some reason: giacomomarchioro@2287c46

# Related recipes

* [Begin playback at a specific point - Time-based media][0015] uses a Point Selector for selecting for starting the playback at a specific time.
* [Simple Annotation — Tagging][0021] a simple annotation pointing to a region of an image.

{% include acronyms.md %}
{% include links.md %}
90 changes: 90 additions & 0 deletions recipe/0135-annotating-point-in-canvas/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"@context": ["http://iiif.io/api/presentation/3/context.json",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is causing the build error. It shouldn't have a , at the end.

],
"id": "{{ id.url }}",
"type": "Manifest",
"label": {
"en": [
"Using a point selector for annotating a location on a map."
]
},
"summary": {
"en": [
"A map containing an point with an annotation of the location."
]
},
"items": [
{
"id": "{{ id.path }}/canvas.json",
"type": "Canvas",
"label": {
"en": [
"Chesapeake and Ohio Canal Pamphlet"
]
},
"height": 5212,
"width": 7072,
"items": [
{
"id": "{{ id.path }}/contentPage.json",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/content.json",
"type": "Annotation",
"motivation": "painting",
"body": {
"id": "https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674/full/max/0/default.jpg",
"type": "Image",
"format": "image/jpeg",
"height": 5212,
"width": 7072,
"service": [
{
"id": "https://iiif.io/api/image/3.0/example/reference/43153e2ec7531f14dd1c9b2fc401678a-88695674",
"type": "ImageService3",
"profile": "level1"
}
]
},
"target": "{{ id.path }}/canvas.json"
}
]
}
],
"annotations": [
{
"id": "{{ id.path }}/page/p2/1",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/annotation/p0002-tag",
"type": "Annotation",
"label": {
"en": [
"Annotation containing the name of the place annotated using the PointSelector."
]
},
"motivation": "tagging",
"body": {
"type": "TextualBody",
"value": "Town Creek Aqueduct",
"language": "en",
"format": "text/plain"
},
"target": {
"type": "SpecificResource",
"source": "{{ id.path }}/canvas.json",
"selector": {
"type": "PointSelector",
"x": 3385,
"y": 1464
}
}
}
]
}
]
}
]
}